-
Notifications
You must be signed in to change notification settings - Fork 142
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
fix(dataGrid): header scroll issues #6135
fix(dataGrid): header scroll issues #6135
Conversation
✅ Deploy Preview for carbon-for-ibm-products ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
9d60c0c
Thanks @devadula-nandan, I confirm it works on https://carbon-for-ibm-products.netlify.app/?path=/story/ibm-products-components-datagrid--infinite-scroll&globals=viewport:basic and https://carbon-for-ibm-products.netlify.app/?path=/story/ibm-products-components-datagrid--with-virtualized-data&globals=viewport:basic. Do you have an opinion about @carbon/react's scrolling strategy, which scrolls on the table wrapper via the stickyHeader... vs. @carbon/ibm-products strategy of scrolling on thead/tbody? |
Hi @wkeese, here is my playground while i was experimenting on sticky header with horizontal and vertical scroll, on a constrained table. its not a carbon example but however carbon's implementation does have sticky and top 0 on thead, but columns doesnt have defined widths like tanstack does, hence we cant get horizontal scrolling to work effectively afaik and coming to datagrid there is this dependency that got built up on certain implementations within datagrid, to an extent that we need to re architect and could also potentially bring regressions, hence we moved to tanstack-carbon way, in which u can use carbon's datatable features, and u can also bring in your own custom changes. hope this helps |
Thanks @devadula-nandan, that all makes sense, although it will personally take me a while to get used to a vertical scrollbar that extends up to the top of the headers. I wonder why ibm-products Datagrid decided to break ranks with @carbon's DataTable and put separate scrolling on the table body. But iIn any case, I agree that scrolling on the table itself (or a wrapper around the table) makes sense. Your playground seems to work perfectly. |
Closes #5948
flex: 1 0 auto
property.Screen.Recording.2024-10-01.at.12.37.50.PM.mov
What did you change?
packages/ibm-products-styles/src/components/Datagrid/styles/_datagrid.scss
packages/ibm-products/src/components/Datagrid/Datagrid/DatagridVirtualBody.tsx
packages/ibm-products/src/components/Datagrid/Datagrid/DatagridRow.tsx
How did you test and verify your work?
storybook, dev tools touch simulation.