Skip to content

High performance self-hosted photo and video management solution.

fix: dispatch menu onPressed manually (#29353)

shenlonge9d1951858cd
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 d55f5e25a3..ee2dace729 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)),
);
}