fix(ContextMenu): prevent event propagation on menu click to improve usability

This commit is contained in:
shiyu
2026-03-15 16:07:23 +08:00
parent f96a4dce11
commit 4038a7292a
@@ -255,8 +255,10 @@ export const ContextMenu: React.FC<ContextMenuProps> = (props) => {
height="auto" height="auto"
styles={{ body: { padding: 8 } }} styles={{ body: { padding: 8 } }}
> >
<div onClick={(e) => e.stopPropagation()}>
<Menu <Menu
items={items} items={items}
mode="inline"
selectable={false} selectable={false}
onClick={({ key }) => { onClick={({ key }) => {
const handler = handlerMap.get(String(key)); const handler = handlerMap.get(String(key));
@@ -266,6 +268,7 @@ export const ContextMenu: React.FC<ContextMenuProps> = (props) => {
}} }}
style={{ borderRadius: token.borderRadius, background: 'transparent', border: 'none' }} style={{ borderRadius: token.borderRadius, background: 'transparent', border: 'none' }}
/> />
</div>
</Drawer> </Drawer>
); );
} }