Skip to content

Commit baeedf5

Browse files
feat: close popover on AddOptionButton tap
1 parent b7f369b commit baeedf5

File tree

1 file changed

+7
-2
lines changed
  • frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option

1 file changed

+7
-2
lines changed

frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class SelectOptionTypeOptionWidget extends StatelessWidget {
5454
),
5555
),
5656
if (state.options.isEmpty && !state.isEditingOption)
57-
const _AddOptionButton(),
57+
_AddOptionButton(popoverMutex: popoverMutex),
5858
_OptionList(popoverMutex: popoverMutex)
5959
];
6060

@@ -240,7 +240,11 @@ class _OptionCellState extends State<_OptionCell> {
240240
}
241241

242242
class _AddOptionButton extends StatelessWidget {
243-
const _AddOptionButton({Key? key}) : super(key: key);
243+
final PopoverMutex? popoverMutex;
244+
const _AddOptionButton({
245+
Key? key,
246+
this.popoverMutex,
247+
}) : super(key: key);
244248

245249
@override
246250
Widget build(BuildContext context) {
@@ -252,6 +256,7 @@ class _AddOptionButton extends StatelessWidget {
252256
fontSize: 12),
253257
hoverColor: theme.hover,
254258
onTap: () {
259+
popoverMutex?.close();
255260
context
256261
.read<SelectOptionTypeOptionBloc>()
257262
.add(const SelectOptionTypeOptionEvent.addingOption());

0 commit comments

Comments
 (0)