Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

fix: editing cell height when editing row contains multi text cell

appflowy4a21a10b948c
diff --git a/frontend/app_flowy/lib/plugins/board/presentation/card/board_cell.dart b/frontend/app_flowy/lib/plugins/board/presentation/card/board_cell.dart
index 580ebe6c5e..e8a0406e0f 100644
--- a/frontend/app_flowy/lib/plugins/board/presentation/card/board_cell.dart
+++ b/frontend/app_flowy/lib/plugins/board/presentation/card/board_cell.dart
@@ -14,33 +14,37 @@ class EditableCellNotifier {
}
class EditableRowNotifier {
- Map<EditableCellId, EditableCellNotifier> cells = {};
+ final Map<EditableCellId, EditableCellNotifier> _cells = {};
void insertCell(
GridCellIdentifier cellIdentifier,
EditableCellNotifier notifier,
) {
- cells[EditableCellId.from(cellIdentifier)] = notifier;
+ _cells[EditableCellId.from(cellIdentifier)] = notifier;
}
void becomeFirstResponder() {
- for (final notifier in cells.values) {
+ for (final notifier in _cells.values) {
notifier.becomeFirstResponder.notify();
}
}
void resignFirstResponder() {
- for (final notifier in cells.values) {
+ for (final notifier in _cells.values) {
notifier.resignFirstResponder.notify();
}
}
+ void clear() {
+ _cells.clear();
+ }
+
void dispose() {
- for (final notifier in cells.values) {
+ for (final notifier in _cells.values) {
notifier.resignFirstResponder.notify();
}
- cells.clear();
+ _cells.clear();
}
}
diff --git a/frontend/app_flowy/lib/plugins/board/presentation/card/card.dart b/frontend/app_flowy/lib/plugins/board/presentation/card/card.dart
index 924faef0a5..9d5aefd9bc 100644
--- a/frontend/app_flowy/lib/plugins/board/presentation/card/card.dart
+++ b/frontend/app_flowy/lib/plugins/board/presentation/card/card.dart
@@ -89,20 +89,20 @@ class _BoardCardState extends State<BoardCard> {
List<GridCellIdentifier> cells,
) {
final List<Widget> children = [];
+ rowNotifier.clear();
cells.asMap().forEach(
(int index, GridCellIdentifier cellId) {
final cellNotifier = EditableCellNotifier();
Widget child = widget.cellBuilder.buildCell(
widget.groupId,
cellId,
- widget.isEditing,
+ index == 0 ? widget.isEditing : false,
cellNotifier,
);
if (index == 0) {
rowNotifier.insertCell(cellId, cellNotifier);
}
-
child = Padding(
key: cellId.key(),
padding: const EdgeInsets.only(left: 4, right: 4),