From e68bc6b106019c002eb2e80163c8af2d14a163bc Mon Sep 17 00:00:00 2001 From: Vildan Softic Date: Mon, 15 Jul 2024 21:54:53 +0200 Subject: [PATCH] fix: revert to old behavior but properly generate picker labels fixes #1605 --- packages/common/src/core/slickGrid.ts | 5 ++--- packages/common/src/global-grid-options.ts | 5 +++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/common/src/core/slickGrid.ts b/packages/common/src/core/slickGrid.ts index 0009f3a85..a60b23859 100644 --- a/packages/common/src/core/slickGrid.ts +++ b/packages/common/src/core/slickGrid.ts @@ -593,8 +593,7 @@ export class SlickGrid = Column, O e if (emptyTarget) { emptyElement(target); } - const node = options?.cloneNode ? val.cloneNode(true) : val; - target.appendChild(node); + target.appendChild(val); } else { // when it's already empty and we try to reassign empty, it's probably ok to skip the assignment const skipEmptyReassignment = options?.skipEmptyReassignment !== false; @@ -2793,7 +2792,7 @@ export class SlickGrid = Column, O e w = this.columns[i].width || 0; rule = this.getColumnCssRules(i); - if (rule.left) { + if (rule.left) { rule.left.style.left = `${x}px`; } if (rule.right) { diff --git a/packages/common/src/global-grid-options.ts b/packages/common/src/global-grid-options.ts index 3e6695981..e889b55af 100644 --- a/packages/common/src/global-grid-options.ts +++ b/packages/common/src/global-grid-options.ts @@ -279,5 +279,10 @@ function pickerHeaderColumnValueExtractor(column: Column, gridOptions?: GridOpti if (headerGroup) { return headerGroup + columnGroupSeparator + column.name; } + + if (column?.name instanceof HTMLElement || column?.name instanceof DocumentFragment) { + return column.name.textContent ?? ''; + } + return column?.name ?? ''; }