Skip to content

Commit 4a21a10

Browse files
committed
fix: editing cell height when editing row contains multi text cell
1 parent a5cbb82 commit 4a21a10

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

frontend/app_flowy/lib/plugins/board/presentation/card/board_cell.dart

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,37 @@ class EditableCellNotifier {
1414
}
1515

1616
class EditableRowNotifier {
17-
Map<EditableCellId, EditableCellNotifier> cells = {};
17+
final Map<EditableCellId, EditableCellNotifier> _cells = {};
1818

1919
void insertCell(
2020
GridCellIdentifier cellIdentifier,
2121
EditableCellNotifier notifier,
2222
) {
23-
cells[EditableCellId.from(cellIdentifier)] = notifier;
23+
_cells[EditableCellId.from(cellIdentifier)] = notifier;
2424
}
2525

2626
void becomeFirstResponder() {
27-
for (final notifier in cells.values) {
27+
for (final notifier in _cells.values) {
2828
notifier.becomeFirstResponder.notify();
2929
}
3030
}
3131

3232
void resignFirstResponder() {
33-
for (final notifier in cells.values) {
33+
for (final notifier in _cells.values) {
3434
notifier.resignFirstResponder.notify();
3535
}
3636
}
3737

38+
void clear() {
39+
_cells.clear();
40+
}
41+
3842
void dispose() {
39-
for (final notifier in cells.values) {
43+
for (final notifier in _cells.values) {
4044
notifier.resignFirstResponder.notify();
4145
}
4246

43-
cells.clear();
47+
_cells.clear();
4448
}
4549
}
4650

frontend/app_flowy/lib/plugins/board/presentation/card/card.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,20 @@ class _BoardCardState extends State<BoardCard> {
8989
List<GridCellIdentifier> cells,
9090
) {
9191
final List<Widget> children = [];
92+
rowNotifier.clear();
9293
cells.asMap().forEach(
9394
(int index, GridCellIdentifier cellId) {
9495
final cellNotifier = EditableCellNotifier();
9596
Widget child = widget.cellBuilder.buildCell(
9697
widget.groupId,
9798
cellId,
98-
widget.isEditing,
99+
index == 0 ? widget.isEditing : false,
99100
cellNotifier,
100101
);
101102

102103
if (index == 0) {
103104
rowNotifier.insertCell(cellId, cellNotifier);
104105
}
105-
106106
child = Padding(
107107
key: cellId.key(),
108108
padding: const EdgeInsets.only(left: 4, right: 4),

0 commit comments

Comments
 (0)