Merge pull request #524 from moksh-mahajan/RenamingWindowAutoClose

fix: Close renaming window when creating another new option
This commit is contained in:
Nathan.fooo 2022-06-03 12:06:32 +08:00 committed by GitHub
commit 0f71851433
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 0 deletions

View File

@ -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));
},

View File

@ -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);

View File

@ -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(