-
Notifications
You must be signed in to change notification settings - Fork 843
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
Fixes EuiInMemoryTable resetting when props update #1008
Fixes EuiInMemoryTable resetting when props update #1008
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thank you for jumping on this so quickly!
<EuiInMemoryTable {...props} /> | ||
); | ||
|
||
component.find('[data-test-subj="pagination-button-1"]').first().simulate('click'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding that - I was looking at this component yesterday and couldn't find a test that did this 👍
CHANGELOG.md
Outdated
@@ -4,6 +4,10 @@ | |||
- Add typings for `EuiFlyout`, `EuiFlyoutBody`, `EuiFlyoutHeader`, and `EuiFlyoutFooter` ([#1001](https://github.com/elastic/eui/pull/1001)) | |||
- Gave `EuiFlyout` close button a data-test-subj ([#1000](https://github.com/elastic/eui/pull/1000)) | |||
|
|||
**Bug fixes** | |||
|
|||
- `EuiInMemoryTable` no longer resets to the first page on prop update when `items` remains the same ([#1008](https://github.com/elastic/eui/pull/1008)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
Fixes #1007
EuiInMemoryTable::getDerivedStateFromProps
was incorrectly checking the current items against previous items to determine if it needed to reset. This caused the component to reset anytime it's parent updated the props (such as item selection getting cleared during pagination).