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] Fix console error that occurs when sorting and then hiding all columns #5635

Merged
merged 5 commits into from
Feb 22, 2022

Conversation

cee-chen
Copy link
Contributor

@cee-chen cee-chen commented Feb 14, 2022

Summary

I noticed this error when randomly testing the schema example on local dev. This error appears to only occur on data grids with sorting and without trailing control columns, so https://elastic.github.io/eui/#/tabular-content/data-grid-in-memory-settings and https://elastic.github.io/eui/#/tabular-content/data-grid-schemas-and-popovers but not the main datagrid example.

It's not a serious error and doesn't affect any actual rendering, but does generate a JS/console error that is a relatively easy fix.

Repro:

  1. Change the sorting column
  2. Click the columns control selector and click the "Hide all" button
  3. Notice the console error pop up.

before

Unit test check

When the newly added unit tests are run against the old code without this fix, the last test fails as expected.

Checklist

@cee-chen cee-chen force-pushed the datagrid/get-column-width-error branch from 11ab2ab to de804c0 Compare February 14, 2022 20:44
@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@cee-chen
Copy link
Contributor Author

@chandlerprall Quick re-ping on this one in case it fell off your radar!

Copy link
Contributor

@chandlerprall chandlerprall left a comment

Choose a reason for hiding this comment

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

Changes LGTM; pulled & tested locally

@cee-chen cee-chen merged commit e0dd7da into elastic:main Feb 22, 2022
@cee-chen cee-chen deleted the datagrid/get-column-width-error branch February 22, 2022 19:43
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