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

Prevent toggling loading on tables from re-mounting visible rows #2754

Merged

Conversation

chandlerprall
Copy link
Contributor

@chandlerprall chandlerprall commented Jan 13, 2020

Fixes #2612

Summary

Removed EuiLoadingTableBody & moved its functionality into EuiBasicTable. This prevents React from un- and re-mounting visible table rows and their components when the loading prop changes, as the virtual dom structure remains the same.

This also fixes a memory leak where the event listeners added which prevent interactions on a loading table were never removed.

For testing, I've modified the first table example (A simple BasicTable) to have a popover on the Nationality column. A setIsLoading function is added to the window object for toggling the table's state - execute it through the developer console, passing true or false. I'll revert the changes to this example before merging.

Checklist

- [ ] Check against all themes for compatibility in both light and dark modes
- [ ] Checked in mobile
- [ ] Checked in IE11 and Firefox
- [ ] Props have proper autodocs
- [ ] Added documentation examples

  • Added or updated jest 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

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

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

LGTM. Tested locally withwindow.setIsLoading in the console.

Needs a docs reversion and a CL entry

@thompsongl
Copy link
Contributor

thompsongl commented Jan 13, 2020

Also, the issue tagged this as urgent for 7.6. Are we looking to get this in with the (likely) backport release coming later this week?

@snide
Copy link
Contributor

snide commented Jan 13, 2020

Also, the issue tagged this as urgent for 7.6. Are we looking to get this in with the (likely) backport release coming later this week?

Yes. This was at request from @bmcconaghy and @mikecote. Their UI won't be active for 7.6 but I know they wanted this PR so they didn't need to comment out a bunch of tests.

@thompsongl thompsongl mentioned this pull request Jan 13, 2020
6 tasks
@chandlerprall
Copy link
Contributor Author

Example reverted, changelog added. Will merge on green.

@chandlerprall chandlerprall merged commit 7fb9865 into elastic:master Jan 13, 2020
thompsongl added a commit that referenced this pull request Jan 13, 2020
@mikecote
Copy link

Thanks for getting this done! Sorry I couldn't review as I was out on vacation. This solves the issue on our end 🙏 👍

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

Successfully merging this pull request may close these issues.

Setting isLoading in BasicTable causing ComputedColumn to lose state
4 participants