Skip to content
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] Allow the grid to expand & contract with changing rowCount values #5313

Conversation

chandlerprall
Copy link
Contributor

@chandlerprall chandlerprall commented Oct 21, 2021

Summary

Addresses part of #5030, where increasing the row count in a pagination-less grid only works the first time, and subsequent updates trigger a scroll bar. The issue was the established height was being used to limit the grid's viewport, and that limit was being re-applied with changes to rowCount instead of dropping the limit & re-calculating.

Before

rowcount_before.mov

After

rowcount_after.mov

Checklist

- [ ] Check against all themes for compatibility in both light and dark modes
- [ ] Checked in mobile

  • Checked in Chrome, Safari, Edge, and Firefox
    - [ ] Props have proper autodocs and playground toggles
    - [ ] Added documentation
    - [ ] Checked Code Sandbox works for any docs examples
    - [ ] Added or updated jest and cypress tests
  • Checked for breaking changes and labeled appropriately
  • Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately
  • Reverted [revert me] commit

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5313/

@cee-chen
Copy link
Contributor

I'm not sure if I'm testing incorrectly, but I'm on https://eui.elastic.co/pr_5313/#/tabular-content/data-grid on latest Firefox and this isn't working for me unfortunately. After 2 rows the max height appears to be cached and the scrollbar appears + removing rows does not fix the grid height.

qhP7yKIONh.mp4

@chandlerprall chandlerprall added this to the Elastic Stack 8.0 milestone Oct 26, 2021
Copy link
Contributor

@cee-chen cee-chen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My FF appears to be defective in its testing 🙈 Greg, Bree, and Trevor have all confirmed this is working for them, and the logic seems sound, so let's move ahead with this! (NB: don't forget to revert)

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5313/

@chandlerprall chandlerprall merged commit 343435f into elastic:master Oct 27, 2021
@chandlerprall chandlerprall deleted the bug/5030-datagrid-resize-with-rowcount branch October 27, 2021 14:26
ym pushed a commit to ym/eui that referenced this pull request Oct 29, 2021
…unt values (elastic#5313)

* Allow the datagrid to expand&contract in response to different row counts, when no pagination is present

* changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants