Skip to content

[EuiDataGrid] Fix console error that occurs when sorting and then hiding all columns - #5635

Merged
cee-chen merged 5 commits into
elastic:mainfrom
cee-chen:datagrid/get-column-width-error
Feb 22, 2022
Merged

cee-chen merged 5 commits into
elastic:mainfrom
cee-chen:datagrid/get-column-width-error

Conversation

@cee-chen

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

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

@kibanamachine

Copy link
Copy Markdown
Contributor

@kibanamachine

Copy link
Copy Markdown
Contributor

@cee-chen

Copy link
Copy Markdown
Contributor Author

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

@chandlerprall chandlerprall left a comment

Copy link
Copy Markdown
Contributor

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