From cf6ad8575f212490167093ddf8634a1d22f2251f Mon Sep 17 00:00:00 2001 From: Moksh Mahajan Date: Wed, 1 Jun 2022 23:49:16 +0530 Subject: [PATCH] fix: close renaming window when creating another new option --- .../widgets/cell/select_option_cell/select_option_editor.dart | 1 + .../grid/src/widgets/cell/select_option_cell/text_field.dart | 3 +++ .../src/widgets/header/type_option/select_option_editor.dart | 2 ++ 3 files changed, 6 insertions(+) diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/select_option_cell/select_option_editor.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/select_option_cell/select_option_editor.dart index 1829157f51..e9dc6afa96 100644 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/select_option_cell/select_option_editor.dart +++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/select_option_cell/select_option_editor.dart @@ -156,6 +156,7 @@ class _TextField extends StatelessWidget { selectedOptionMap: optionMap, distanceToText: _editorPannelWidth * 0.7, tagController: _tagController, + onClick: () => FlowyOverlay.of(context).remove(SelectOptionTypeOptionEditor.identifier), newText: (text) { context.read().add(SelectOptionEditorEvent.filterOption(text)); }, diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/select_option_cell/text_field.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/select_option_cell/text_field.dart index 125a86a609..398d98a994 100644 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/select_option_cell/text_field.dart +++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/select_option_cell/text_field.dart @@ -22,6 +22,7 @@ class SelectOptionTextField extends StatelessWidget { final Function(String) onNewTag; final Function(String) newText; + final VoidCallback? onClick; SelectOptionTextField({ required this.options, @@ -30,6 +31,7 @@ class SelectOptionTextField extends StatelessWidget { required this.tagController, required this.onNewTag, required this.newText, + this.onClick, TextEditingController? controller, FocusNode? focusNode, Key? key, @@ -53,6 +55,7 @@ class SelectOptionTextField extends StatelessWidget { autofocus: true, controller: editController, focusNode: focusNode, + onTap: onClick, onChanged: (text) { if (onChanged != null) { onChanged(text); diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/type_option/select_option_editor.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/type_option/select_option_editor.dart index dada59b41c..cec32bd99e 100644 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/type_option/select_option_editor.dart +++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/type_option/select_option_editor.dart @@ -25,6 +25,8 @@ class SelectOptionTypeOptionEditor extends StatelessWidget { Key? key, }) : super(key: key); + static String get identifier => (SelectOptionTypeOptionEditor).toString(); + @override Widget build(BuildContext context) { return BlocProvider(