Skip to content

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

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

[EuiDataGrid] Fix console error that occurs when sorting and then hiding all columns#5635
cee-chen merged 5 commits intoelastic:mainfrom
cee-chen:datagrid/get-column-width-error

Conversation

@cee-chen
Copy link
Copy Markdown
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
Copy Markdown

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

@kibanamachine
Copy link
Copy Markdown

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

@kibanamachine
Copy link
Copy Markdown

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

@cee-chen
Copy link
Copy Markdown
Contributor Author

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

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