Skip to content

Commit

Permalink
fix(Dialog): prevent default for contextmenu event (#2087)
Browse files Browse the repository at this point in the history
  • Loading branch information
shaharzil authored Apr 24, 2024
1 parent 57ad30d commit 483c47f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/core/src/components/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,13 @@ export default class Dialog extends PureComponent<DialogProps, DialogState> {
}

onContextMenu(e: React.MouseEvent) {
const isShown = this.isShown();
if (
(this.isShowTrigger(HideShowEvent.CONTEXT_MENU) && !isShown) ||
(this.isHideTrigger(HideShowEvent.CONTEXT_MENU) && isShown)
) {
e.preventDefault();
}
this.handleEvent(HideShowEvent.CONTEXT_MENU, e.target, e);
}

Expand Down

0 comments on commit 483c47f

Please sign in to comment.