浏览代码

Merge pull request #1017 from richardshiue/fix-empty-create-select-tag

fix: empty create option in select/multi-select properties
Nathan.fooo 2 年之前
父节点
当前提交
61ea7ea3df
共有 1 个文件被更改,包括 7 次插入13 次删除
  1. 7 13
      frontend/app_flowy/lib/plugins/grid/application/cell/select_option_editor_bloc.dart

+ 7 - 13
frontend/app_flowy/lib/plugins/grid/application/cell/select_option_editor_bloc.dart

@@ -103,19 +103,11 @@ class SelectOptionCellEditorBloc
   void _filterOption(String optionName, Emitter<SelectOptionEditorState> emit) {
     final _MakeOptionResult result =
         _makeOptions(Some(optionName), state.allOptions);
-    if (optionName.isEmpty) {
-      emit(state.copyWith(
-        filter: Some(optionName),
-        options: result.options,
-        createOption: none(),
-      ));
-    } else {
-      emit(state.copyWith(
-        filter: Some(optionName),
-        options: result.options,
-        createOption: result.createOption,
-      ));
-    }
+    emit(state.copyWith(
+      filter: Some(optionName),
+      options: result.options,
+      createOption: result.createOption,
+    ));
   }
 
   void _loadOptions() {
@@ -154,6 +146,8 @@ class SelectOptionCellEditorBloc
 
           return name.contains(lFilter);
         });
+      } else {
+        createOption = none();
       }
     });