Skip to content

Commit 84ce505

Browse files
authored
Prevent propagation of popup menu items (#979)
1 parent 6011780 commit 84ce505

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/stale-colts-pretend.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@ensembleui/react-runtime": patch
3+
---
4+
5+
Prevent propagation of popupmenu items

packages/runtime/src/widgets/PopupMenu.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ export const PopupMenu: React.FC<PopupMenuProps> = ({
179179
}, [namedData, values?.items]);
180180

181181
const handleMenuItemClick = useCallback<NonNullable<MenuProps["onClick"]>>(
182-
({ key }) => {
182+
({ key, domEvent }) => {
183+
domEvent.stopPropagation();
183184
const mapKey = join(tail(key.split("_")), "_");
184185
const item = itemsMap.get(mapKey);
185186
action?.callback({ value: item });

0 commit comments

Comments
 (0)