mirror of
https://github.com/DrizzleTime/Foxel.git
synced 2026-05-06 18:22:44 +08:00
fix(ContextMenu): prevent event propagation on menu click to improve usability
This commit is contained in:
@@ -255,8 +255,10 @@ export const ContextMenu: React.FC<ContextMenuProps> = (props) => {
|
||||
height="auto"
|
||||
styles={{ body: { padding: 8 } }}
|
||||
>
|
||||
<div onClick={(e) => e.stopPropagation()}>
|
||||
<Menu
|
||||
items={items}
|
||||
mode="inline"
|
||||
selectable={false}
|
||||
onClick={({ 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' }}
|
||||
/>
|
||||
</div>
|
||||
</Drawer>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user