From 28113f4473c78fa9fccda7ade279d57c7b4b5d5e Mon Sep 17 00:00:00 2001 From: Ghislain B Date: Wed, 19 Jun 2024 20:38:13 -0400 Subject: [PATCH] fix: new preheader event should work with any prehader content (#1034) --- src/slick.grid.ts | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/src/slick.grid.ts b/src/slick.grid.ts index 6da71003..7963d414 100644 --- a/src/slick.grid.ts +++ b/src/slick.grid.ts @@ -5609,30 +5609,22 @@ export class SlickGrid = Column, O e } protected handleHeaderClick(e: MouseEvent & { target: HTMLElement; }) { - if (this.columnResizeDragging) { - return; - } - - const header = e.target.closest('.slick-header-column'); - const column = header && Utils.storage.get(header, 'column'); - if (column) { - this.trigger(this.onHeaderClick, { column }, e); + if (!this.columnResizeDragging) { + const header = e.target.closest('.slick-header-column'); + const column = header && Utils.storage.get(header, 'column'); + if (column) { + this.trigger(this.onHeaderClick, { column }, e); + } } } protected handlePreHeaderContextMenu(e: MouseEvent & { target: HTMLElement; }) { - const header = e.target.closest('.slick-header-column'); - this.trigger(this.onPreHeaderContextMenu, { node: header }, e); + this.trigger(this.onPreHeaderContextMenu, { node: e.target }, e); } protected handlePreHeaderClick(e: MouseEvent & { target: HTMLElement; }) { - if (this.columnResizeDragging) { - return; - } - - const header = e.target.closest('.slick-header-column'); - if (header) { - this.trigger(this.onPreHeaderClick, { node: header }, e); + if (!this.columnResizeDragging) { + this.trigger(this.onPreHeaderClick, { node: e.target }, e); } }