Skip to content

Commit

Permalink
fix: new preheader event should work with any prehader content (#1034)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding authored Jun 20, 2024
1 parent b704a81 commit 28113f4
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions src/slick.grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5609,30 +5609,22 @@ export class SlickGrid<TData = any, C extends Column<TData> = Column<TData>, 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);
}
}

Expand Down

0 comments on commit 28113f4

Please sign in to comment.