From e9d1951858cd4396096b6a512d46f5d12c7ec0f4 Mon Sep 17 00:00:00 2001 From: shenlong <139912620+shenlong-tanwen@users.noreply.github.com> Date: Sat, 27 Jun 2026 18:40:47 +0530 Subject: [PATCH] fix: dispatch menu onPressed manually (#29353) Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> --- .../action_buttons/base_action_button.widget.dart | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mobile/lib/presentation/widgets/action_buttons/base_action_button.widget.dart b/mobile/lib/presentation/widgets/action_buttons/base_action_button.widget.dart index d55f5e25a..ee2dace72 100644 --- a/mobile/lib/presentation/widgets/action_buttons/base_action_button.widget.dart +++ b/mobile/lib/presentation/widgets/action_buttons/base_action_button.widget.dart @@ -49,14 +49,21 @@ class BaseActionButton extends ConsumerWidget { if (menuItem) { final iconColor = this.iconColor; + final onPressed = this.onPressed; return MenuItemButton( + closeOnActivate: false, style: MenuItemButton.styleFrom( alignment: Alignment.centerLeft, padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14), ), leadingIcon: Icon(iconData, color: iconColor, size: 20), - onPressed: onPressed, + onPressed: onPressed == null + ? null + : () { + onPressed(); + MenuController.maybeOf(context)?.close(); + }, child: Text(label, style: TextStyle(fontSize: 15, color: iconColor)), ); }