Skip to content

Commit

Permalink
Fix click event is overridden when clicking menu button in item mailbox
Browse files Browse the repository at this point in the history
  • Loading branch information
dab246 committed Aug 14, 2024
1 parent 5c95fb9 commit 920ea8a
Showing 1 changed file with 29 additions and 23 deletions.
52 changes: 29 additions & 23 deletions lib/features/mailbox/presentation/mailbox_view_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,37 @@ class MailboxView extends BaseMailboxView {
key: const Key('children_tree_mailbox_child'),
isExpanded: mailboxNode.expandMode == ExpandMode.EXPAND,
paddingChild: const EdgeInsetsDirectional.only(start: 14),
parent: Obx(() => MailboxItemWidget(
parent: Obx(() => Semantics(
excludeSemantics: true,
child: MailboxItemWidget(
mailboxNode: mailboxNode,
mailboxNodeSelected: controller.mailboxDashBoardController.selectedMailbox.value,
onOpenMailboxFolderClick: (mailboxNode) => controller.openMailbox(context, mailboxNode.item),
onExpandFolderActionClick: (mailboxNode) => controller.toggleMailboxFolder(mailboxNode, controller.mailboxListScrollController),
onSelectMailboxFolderClick: controller.selectMailboxNode,
onDragItemAccepted: _handleDragItemAccepted,
onMenuActionClick: (position, mailboxNode) {
openMailboxMenuActionOnWeb(
context,
controller.imagePaths,
controller.responsiveUtils,
position,
mailboxNode.item,
controller
);
},
onEmptyMailboxActionCallback: (mailboxNode) => controller.emptyMailboxAction(context, mailboxNode.item),
),
)),
children: _buildListChildTileWidget(context, mailboxNode)
).build();
} else {
return Obx(() => Semantics(
excludeSemantics: true,
child: MailboxItemWidget(
mailboxNode: mailboxNode,
mailboxNodeSelected: controller.mailboxDashBoardController.selectedMailbox.value,
onOpenMailboxFolderClick: (mailboxNode) => controller.openMailbox(context, mailboxNode.item),
onExpandFolderActionClick: (mailboxNode) => controller.toggleMailboxFolder(mailboxNode, controller.mailboxListScrollController),
onSelectMailboxFolderClick: controller.selectMailboxNode,
onDragItemAccepted: _handleDragItemAccepted,
onMenuActionClick: (position, mailboxNode) {
Expand All @@ -299,27 +325,7 @@ class MailboxView extends BaseMailboxView {
);
},
onEmptyMailboxActionCallback: (mailboxNode) => controller.emptyMailboxAction(context, mailboxNode.item),
)),
children: _buildListChildTileWidget(context, mailboxNode)
).build();
} else {
return Obx(() => MailboxItemWidget(
mailboxNode: mailboxNode,
mailboxNodeSelected: controller.mailboxDashBoardController.selectedMailbox.value,
onOpenMailboxFolderClick: (mailboxNode) => controller.openMailbox(context, mailboxNode.item),
onSelectMailboxFolderClick: controller.selectMailboxNode,
onDragItemAccepted: _handleDragItemAccepted,
onMenuActionClick: (position, mailboxNode) {
openMailboxMenuActionOnWeb(
context,
controller.imagePaths,
controller.responsiveUtils,
position,
mailboxNode.item,
controller
);
},
onEmptyMailboxActionCallback: (mailboxNode) => controller.emptyMailboxAction(context, mailboxNode.item),
),
));
}
}).toList() ?? <Widget>[];
Expand Down

0 comments on commit 920ea8a

Please sign in to comment.