Skip to content

Commit 4038a72

Browse files
committed
fix(ContextMenu): prevent event propagation on menu click to improve usability
1 parent f96a4dc commit 4038a72

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

web/src/pages/FileExplorerPage/components/ContextMenu.tsx

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -255,17 +255,20 @@ export const ContextMenu: React.FC<ContextMenuProps> = (props) => {
255255
height="auto"
256256
styles={{ body: { padding: 8 } }}
257257
>
258-
<Menu
259-
items={items}
260-
selectable={false}
261-
onClick={({ key }) => {
262-
const handler = handlerMap.get(String(key));
263-
if (!handler) return;
264-
handler();
265-
onClose();
266-
}}
267-
style={{ borderRadius: token.borderRadius, background: 'transparent', border: 'none' }}
268-
/>
258+
<div onClick={(e) => e.stopPropagation()}>
259+
<Menu
260+
items={items}
261+
mode="inline"
262+
selectable={false}
263+
onClick={({ key }) => {
264+
const handler = handlerMap.get(String(key));
265+
if (!handler) return;
266+
handler();
267+
onClose();
268+
}}
269+
style={{ borderRadius: token.borderRadius, background: 'transparent', border: 'none' }}
270+
/>
271+
</div>
269272
</Drawer>
270273
);
271274
}

0 commit comments

Comments
 (0)