From 7c3218cef25688ccbf83955dedb43432f339b812 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Tue, 3 Oct 2023 14:20:43 +0300 Subject: [PATCH] Fixed #4536 - ContextMenu: global property is not working --- components/lib/contextmenu/ContextMenu.vue | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/components/lib/contextmenu/ContextMenu.vue b/components/lib/contextmenu/ContextMenu.vue index 1ebdd5664..382cfc391 100755 --- a/components/lib/contextmenu/ContextMenu.vue +++ b/components/lib/contextmenu/ContextMenu.vue @@ -71,11 +71,9 @@ export default { if (ObjectUtils.isNotEmpty(newPath)) { this.bindOutsideClickListener(); this.bindResizeListener(); - this.bindDocumentContextMenuListener(); } else if (!this.visible) { this.unbindOutsideClickListener(); this.unbindResizeListener(); - this.unbindDocumentContextMenuListener(); } } }, @@ -358,7 +356,6 @@ export default { onAfterEnter() { this.bindOutsideClickListener(); this.bindResizeListener(); - this.bindDocumentContextMenuListener(); this.$emit('show'); DomHandler.focus(this.list); @@ -374,7 +371,6 @@ export default { this.unbindOutsideClickListener(); this.unbindResizeListener(); - this.unbindDocumentContextMenuListener(); }, position() { let left = this.pageX + 1; @@ -446,7 +442,7 @@ export default { bindDocumentContextMenuListener() { if (!this.documentContextMenuListener) { this.documentContextMenuListener = (event) => { - event.button !== 2 ? this.show(event) : this.hide(); + event.button === 2 && this.show(event); }; document.addEventListener('contextmenu', this.documentContextMenuListener);