Skip to content

Commit 64ee314

Browse files
authored
fix: click enter to submit the text content (#1537)
Co-authored-by: nathan <[email protected]>
1 parent a2f9ca2 commit 64ee314

File tree

2 files changed

+3
-25
lines changed

2 files changed

+3
-25
lines changed

frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/text_cell.dart

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ class GridTextCell extends GridCellWidget {
3737
class _GridTextCellState extends GridFocusNodeCellState<GridTextCell> {
3838
late TextCellBloc _cellBloc;
3939
late TextEditingController _controller;
40-
Timer? _delayOperation;
4140

4241
@override
4342
void initState() {
@@ -66,7 +65,9 @@ class _GridTextCellState extends GridFocusNodeCellState<GridTextCell> {
6665
child: TextField(
6766
controller: _controller,
6867
focusNode: focusNode,
69-
onChanged: (value) => focusChanged(),
68+
onSubmitted: (text) => _cellBloc.add(
69+
TextCellEvent.updateText(text),
70+
),
7071
onEditingComplete: () => focusNode.unfocus(),
7172
maxLines: null,
7273
style: Theme.of(context).textTheme.bodyMedium,
@@ -87,24 +88,10 @@ class _GridTextCellState extends GridFocusNodeCellState<GridTextCell> {
8788

8889
@override
8990
Future<void> dispose() async {
90-
_delayOperation = null;
9191
_cellBloc.close();
9292
super.dispose();
9393
}
9494

95-
@override
96-
Future<void> focusChanged() async {
97-
if (mounted) {
98-
_delayOperation?.cancel();
99-
_delayOperation = Timer(const Duration(milliseconds: 30), () {
100-
if (_cellBloc.isClosed == false &&
101-
_controller.text != _cellBloc.state.content) {
102-
_cellBloc.add(TextCellEvent.updateText(_controller.text));
103-
}
104-
});
105-
}
106-
}
107-
10895
@override
10996
String? onCopy() => _cellBloc.state.content;
11097

frontend/app_flowy/lib/plugins/grid/presentation/widgets/filter/choicechip/select_option/select_option.dart

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,3 @@ class _SelectOptionFilterEditorState extends State<SelectOptionFilterEditor> {
167167
);
168168
}
169169
}
170-
171-
class _FilterPannel extends StatelessWidget {
172-
const _FilterPannel({Key? key}) : super(key: key);
173-
174-
@override
175-
Widget build(BuildContext context) {
176-
return Container();
177-
}
178-
}

0 commit comments

Comments
 (0)