Reputation: 625
I have a table with react-table v7. Have used react-window for virtualisation. Now the table has last column fixed but I am unable to fix the last column of the table. React-window's internal element has overflow: auto
which is not letting the column to be sticky at last.
Here's the link reproduce the issue.
I am trying to achieve something around these lines.
If you see the issue link, I want the last row to be fixed at a position and keep the rest horizontally scrollable.
Upvotes: 2
Views: 9555
Reputation: 414
Hi I created this reusable react component
https://codesandbox.io/s/react-window-sticky-grid-forked-kkcf2z?file=/src/CustomVirtualGrid.js
Upvotes: 0
Reputation: 61
Sticky columns and rows could be implemented by using innerElementType
property of FixedSizeList
provided by react-window
.
Here's a working example:
https://codesandbox.io/s/dazzling-field-48x39?file=/src/App.tsx
Upvotes: 1
Reputation: 572
For sticky header you should implement innerElementType props as react-window said like this.
But for sticky column maybe more standard way of that is to use another grid or list beside that and sync their scroll position like this one.
you could also use react-base-table which implement whole side sticky rows and columns.
Upvotes: 2
Reputation: 11
I encountered this exact same issue. I came up with a solution that:
Once I did this, it allowed my sticky column to be 'sticky' again. I hope this helps you as well.
Upvotes: 1