From 2a9d50775a4695fb21b422742a5b5a5ec1f0ca7b Mon Sep 17 00:00:00 2001 From: PC0 Date: Thu, 7 Mar 2024 12:07:40 +0330 Subject: [PATCH 1/4] fixes #14962 context menu onshow event should not be inside onOverlayAnimationStart since it is not being fired when context menu is clicked twice simultaneousl --- src/app/components/contextmenu/contextmenu.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/components/contextmenu/contextmenu.ts b/src/app/components/contextmenu/contextmenu.ts index 244b020b379..6840d7dc813 100755 --- a/src/app/components/contextmenu/contextmenu.ts +++ b/src/app/components/contextmenu/contextmenu.ts @@ -931,7 +931,6 @@ export class ContextMenu implements OnInit, AfterContentInit, OnDestroy { this.moveOnTop(); this.appendOverlay(); this.bindGlobalListeners(); - this.onShow.emit(); DomHandler.focus(this.rootmenu.sublistViewChild.nativeElement); break; } @@ -970,7 +969,6 @@ export class ContextMenu implements OnInit, AfterContentInit, OnDestroy { } this.container = null; - this.onHide.emit(); } onTouchStart(event: MouseEvent) { @@ -987,6 +985,7 @@ export class ContextMenu implements OnInit, AfterContentInit, OnDestroy { this.visible.set(false); this.activeItemPath.set([]); this.focusedItemInfo.set({ index: -1, level: 0, parentKey: '', item: null }); + this.onHide.emit(); } toggle(event?: any) { @@ -1001,6 +1000,7 @@ export class ContextMenu implements OnInit, AfterContentInit, OnDestroy { this.pageY = event.pageY; this.visible() ? this.position() : this.visible.set(true); + this.onShow.emit(); event.stopPropagation(); event.preventDefault(); From 38af6453ea133687a2b5956744dd8448e9a8e8cb Mon Sep 17 00:00:00 2001 From: PC0 Date: Thu, 7 Mar 2024 13:39:45 +0330 Subject: [PATCH 2/4] fixes #14962 - ContextMenu | onHide, onShow event is not being triggered when you right click twice continuously the event should be called before calculations of position. the previous commit made some view bugs when items before onShow was modified --- src/app/components/contextmenu/contextmenu.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/components/contextmenu/contextmenu.ts b/src/app/components/contextmenu/contextmenu.ts index 6840d7dc813..043d493946d 100755 --- a/src/app/components/contextmenu/contextmenu.ts +++ b/src/app/components/contextmenu/contextmenu.ts @@ -982,10 +982,10 @@ export class ContextMenu implements OnInit, AfterContentInit, OnDestroy { } hide() { + this.onHide.emit(); this.visible.set(false); this.activeItemPath.set([]); this.focusedItemInfo.set({ index: -1, level: 0, parentKey: '', item: null }); - this.onHide.emit(); } toggle(event?: any) { @@ -999,8 +999,8 @@ export class ContextMenu implements OnInit, AfterContentInit, OnDestroy { this.pageX = event.pageX; this.pageY = event.pageY; - this.visible() ? this.position() : this.visible.set(true); this.onShow.emit(); + this.visible() ? this.position() : this.visible.set(true); event.stopPropagation(); event.preventDefault(); From 8ce9f34feba7794ba47e2a7be538f2867848598c Mon Sep 17 00:00:00 2001 From: ymg2006 Date: Thu, 7 Mar 2024 23:58:08 +0330 Subject: [PATCH 3/4] Update contextmenu.ts moved onHide event emitter after visible set, the onShow is not moved because when we dynamically want to change context menu items it gets in the correct position, so I put it before this.position() and visible set true method. --- src/app/components/contextmenu/contextmenu.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/contextmenu/contextmenu.ts b/src/app/components/contextmenu/contextmenu.ts index 043d493946d..f4b223aa84a 100755 --- a/src/app/components/contextmenu/contextmenu.ts +++ b/src/app/components/contextmenu/contextmenu.ts @@ -982,8 +982,8 @@ export class ContextMenu implements OnInit, AfterContentInit, OnDestroy { } hide() { - this.onHide.emit(); this.visible.set(false); + this.onHide.emit(); this.activeItemPath.set([]); this.focusedItemInfo.set({ index: -1, level: 0, parentKey: '', item: null }); } From 07a8a974f42c8bfed59b83b3143c93086357dc92 Mon Sep 17 00:00:00 2001 From: PC0 Date: Mon, 11 Mar 2024 14:08:42 +0330 Subject: [PATCH 4/4] no need to filter when removeConstraint called and showApplyButton is visible exactly like onOperatorChange --- src/app/components/table/table.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/components/table/table.ts b/src/app/components/table/table.ts index a0187193892..b0ae0785d63 100644 --- a/src/app/components/table/table.ts +++ b/src/app/components/table/table.ts @@ -5447,7 +5447,9 @@ export class ColumnFilter implements AfterContentInit { removeConstraint(filterMeta: FilterMetadata) { this.dt.filters[this.field] = (this.dt.filters[this.field]).filter((meta) => meta !== filterMeta); - this.dt._filter(); + if (!this.showApplyButton) { + this.dt._filter(); + } DomHandler.focus(this.clearButtonViewChild.nativeElement); }