From 620951703aff9fd681f35c9ba2c7e40dfe15adda Mon Sep 17 00:00:00 2001 From: shaharzil Date: Tue, 23 Apr 2024 14:41:18 +0300 Subject: [PATCH] fix(Dialog): prevent default for contextmenu event --- packages/core/src/components/Dialog/Dialog.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/core/src/components/Dialog/Dialog.tsx b/packages/core/src/components/Dialog/Dialog.tsx index f928deeb75..894e6f9943 100644 --- a/packages/core/src/components/Dialog/Dialog.tsx +++ b/packages/core/src/components/Dialog/Dialog.tsx @@ -457,6 +457,13 @@ export default class Dialog extends PureComponent { } 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); }