From baeedf557d16c1a1db366c8aff79b220f321ea3d Mon Sep 17 00:00:00 2001 From: Cyrine-benabid Date: Sun, 30 Oct 2022 02:24:57 +0200 Subject: [PATCH] feat: close popover on AddOptionButton tap --- .../widgets/header/type_option/select_option.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart index f20d9460e1..3b69f1f2ab 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart @@ -54,7 +54,7 @@ class SelectOptionTypeOptionWidget extends StatelessWidget { ), ), if (state.options.isEmpty && !state.isEditingOption) - const _AddOptionButton(), + _AddOptionButton(popoverMutex: popoverMutex), _OptionList(popoverMutex: popoverMutex) ]; @@ -240,7 +240,11 @@ class _OptionCellState extends State<_OptionCell> { } class _AddOptionButton extends StatelessWidget { - const _AddOptionButton({Key? key}) : super(key: key); + final PopoverMutex? popoverMutex; + const _AddOptionButton({ + Key? key, + this.popoverMutex, + }) : super(key: key); @override Widget build(BuildContext context) { @@ -252,6 +256,7 @@ class _AddOptionButton extends StatelessWidget { fontSize: 12), hoverColor: theme.hover, onTap: () { + popoverMutex?.close(); context .read() .add(const SelectOptionTypeOptionEvent.addingOption());