Skip to content
Source
Sign inSign up
TanStack/table

fix(table-core): add header.getIsPinned() for group headers split across pinned regions #6644

Opensundarshahi(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/6644/headopened

Showing 18 changed files with 10 additions and 6 deletions (loading 15).

x
0 of 18 viewed, 18 left
5 additions and 0 deletions.changeset/header-get-is-pinned.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/table-core': minor
+---
+​
+Add `header.getIsPinned()`, which reads the pinned region of a header's own leaf columns. A group column split across pinned regions renders one header per region, and `header.column.getIsPinned()` reported the same region for all of them (#4906).
4 additions and 6 deletionsdocs/framework/alpine/guide/column-pinning.mdModified
View file
@@ -140,6 +140,7 @@
- `column.getCanPin`: Use to determine if a column can be pinned.
- `column.pin`: Use to pin a column to the start or end. Or use to unpin a column.
- `column.getIsPinned`: Use to determine where a column is pinned.
+- `header.getIsPinned`: Use to determine where a header is pinned. A group header split across pinned regions reports the region it is rendered in, which `header.column.getIsPinned` cannot.
- `column.getPinnedIndex`: Use to read the column's index within its pinned column group.
- `column.getStart`: Use to provide the correct `start` CSS value for a pinned column.
- `column.getAfter`: Use to provide the correct `end` CSS value for a pinned column.
@@ -214,19 +215,16 @@
<template x-if="!header.isPlaceholder && header.column.getCanPin()">
<div class="pin-actions">
<button
- x-show="header.column.getIsPinned() !== 'start'"
+ x-show="header.getIsPinned() !== 'start'"
@click="header.column.pin('start')"
&lt;=
</button>
- <button
- x-show="header.column.getIsPinned()"
- @click="header.column.pin(false)"