-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
there is a bug when you try sticky pin column group #5397
Comments
Hey! I'm having this same issue. I've also noticed that if you group last name & something else (but not first name) you get a duplicated group header, which doesn't have any way to say it's not pinned (as it inherits the column, which is pinned, but the header is not) |
Hey! I confirm that I got the same issue as above. For now I just disabled the possibility to stick column when they are grouped. The issue is that the column.getStart('left') of the group header return the wrong value (the rightmost child header, left position value) but I couldn't find a fix for it after checking the code :( |
Yep! I'm having this same issue. |
Hey folks, we are having the same issue, any news about this? |
I have a workaround where I check if the column have children columns, if so I use the getStart('left') value of the first one otherwise I just get the value normally. Like this:
|
Hey guys, I also have found an issue with sticky columns. Referring to this example: When we make a change like the one below for any column:
Then, as a result, we will see... TanStack Table version |
I don't understand how come using the some snippet from the source code: column.getSize = () => {
const columnSize = table.getState().columnSizing[column.id]
return Math.min(
Math.max(
column.columnDef.minSize ?? defaultColumnSizing.minSize,
columnSize ?? column.columnDef.size ?? defaultColumnSizing.size
),
column.columnDef.maxSize ?? defaultColumnSizing.maxSize
)
}
header.getSize = () => {
let sum = 0
const recurse = (header: Header<TData, TValue>) => {
if (header.subHeaders.length) {
header.subHeaders.forEach(recurse)
} else {
sum += header.column.getSize() ?? 0
}
}
recurse(header)
return sum
}
header.getStart = () => {
if (header.index > 0) {
const prevSiblingHeader = header.headerGroup.headers[header.index - 1]!
return prevSiblingHeader.getStart() + prevSiblingHeader.getSize()
}
return 0
} the example is definitely not a working one for sticky column... |
TanStack Table version
8.13.2
Framework/Library version
18.2.0
Describe the bug and the steps to reproduce it
open https://tanstack.com/table/v8/docs/framework/react/examples/column-pinning-sticky example and group firstname and lastname
then try pin "info" group info to the left (or right).
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
https://stackblitz.com/edit/tanstack-table-n7umup?file=src%2Fmain.tsx
Screenshots or Videos (Optional)
Do you intend to try to help solve this bug with your own PR?
None
Terms & Code of Conduct
The text was updated successfully, but these errors were encountered: