fix: preserve correct column order when table layout is changed with time comparison enabled (#34300)

This commit is contained in:
Pius Iniobong
2025-07-25 13:31:33 +01:00
committed by GitHub
parent 7f44992c4b
commit 9c771fb2ba

View File

@@ -629,7 +629,11 @@ export default function TableChart<D extends DataRecord = DataRecord>(
const startPosition = value[0];
const colSpan = value.length;
// Retrieve the originalLabel from the first column in this group
const originalLabel = columnsMeta[value[0]]?.originalLabel || key;
const firstColumnInGroup = filteredColumnsMeta[startPosition];
const originalLabel = firstColumnInGroup
? columnsMeta.find(col => col.key === firstColumnInGroup.key)
?.originalLabel || key
: key;
// Add placeholder <th> for columns before this header
for (let i = currentColumnIndex; i < startPosition; i += 1) {