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: close renaming window when creating another new option

Moksh Mahajancf6ad8575f21
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<SelectOptionCellEditorBloc>().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(