-
Notifications
You must be signed in to change notification settings - Fork 848
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
[EuiDataGrid] Add scroll anchor row option #6070
[EuiDataGrid] Add scroll anchor row option #6070
Conversation
Preview documentation changes for this PR: https://eui.elastic.co/pr_6070/ |
@constancecchen @chandlerprall I'm struggling to find the time to write an example. Would you accept this with just the docs and tests, but without an example for now? 🙈 |
I'll get a pass at this PR tomorrow (U.S. time), but don't worry about an example - we'll either accept as-is or will put an example together for ya |
… example to anchor rows when width changes
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.
This works really well! I played with a number of configurations locally and everything Just Worked™️
I've added this to the virtualization example, keeping the viewport anchored when toggling between the width options.
Preview documentation changes for this PR: https://eui.elastic.co/pr_6070/ |
src-docs/src/views/datagrid/styling/datagrid_height_options_example.js
Outdated
Show resolved
Hide resolved
Preview documentation changes for this PR: https://eui.elastic.co/pr_6070/ |
…ample.js Co-authored-by: Constance <constancecchen@users.noreply.github.com>
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
@constancecchen @chandlerprall Thanks for the thorough review and contributing tests and an example ❤️ edit: not to forget correcting all by grammar mistakes |
Preview documentation changes for this PR: https://eui.elastic.co/pr_6070/ |
🗒️ Summary
This adds a mechanism to the
EuiDataGrid
to compensate for vertical layout shifts when rows above the currently visible ones change their height. This often happens when the row heights are"auto"
-measured and new rows are rendered in the overscan area. By specifying ascrollAnchorRow: 'start'
, the grid will try to scroll to keep the vertical position of the topmost visible row stable in the viewport. This behavior is opt-in.closes #6024
extracted from #6028
🎨 Previews
Checklist
Updated the Figma library counterpart(no visible changes)