@shival99/z-ui 2.0.85 → 2.0.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4580,12 +4580,21 @@ class ZTablePinningStylesPipe {
|
|
|
4580
4580
|
}
|
|
4581
4581
|
_getBodyPinningStyles(column, cell, allCells, columns, renderedSizeMap) {
|
|
4582
4582
|
const isPinned = column.getIsPinned();
|
|
4583
|
+
// TanStack's getStart/getAfter correctly compute offsets from columnSizingState
|
|
4584
|
+
// and are the source of truth for sticky positioning. The custom body calculation
|
|
4585
|
+
// below is only needed when body cells use colSpan > 1 (which visually shifts
|
|
4586
|
+
// adjacent pinned cells). Without colSpan, always trust TanStack's values.
|
|
4587
|
+
const hasAnyColspan = allCells?.some(c => {
|
|
4588
|
+
const config = findColumnConfig(c.column.id, columns);
|
|
4589
|
+
const colSpan = getBodyColSpan(config, c.getContext());
|
|
4590
|
+
return colSpan !== undefined && colSpan > 1;
|
|
4591
|
+
}) ?? false;
|
|
4583
4592
|
let leftOffset = column.getStart('left');
|
|
4584
4593
|
let rightOffset = column.getAfter('right');
|
|
4585
|
-
if (allCells && cell && isPinned === 'left') {
|
|
4594
|
+
if (hasAnyColspan && allCells && cell && isPinned === 'left') {
|
|
4586
4595
|
leftOffset = this._calculateBodyLeftOffset(cell, allCells, columns, renderedSizeMap);
|
|
4587
4596
|
}
|
|
4588
|
-
if (allCells && cell && isPinned === 'right') {
|
|
4597
|
+
if (hasAnyColspan && allCells && cell && isPinned === 'right') {
|
|
4589
4598
|
rightOffset = this._calculateBodyRightOffset(cell, allCells, columns, renderedSizeMap);
|
|
4590
4599
|
}
|
|
4591
4600
|
return this._buildPinningResult(isPinned, leftOffset, rightOffset);
|