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

[EuiInMemoryTable] Fixed data reset on selection change. #3419

Merged
merged 5 commits into from
May 5, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

**Bug Fixes**

- Fixed `EuiInMemoryTable` data reset when filter is set and item is selected ([#3419](https://github.com/elastic/eui/pull/3419))
- Fixed `EuiBadge` `iconOnClick` props makes badge text clickable ([#3392](https://github.com/elastic/eui/pull/3392))
- Added `id` requirement if `label` is used in `EuiRadio` ([#3382](https://github.com/elastic/eui/pull/3382))
- Fixed z-index issue in `EuiDatePicker` where it's popover would sit beneath other DOM siblings that had z-index applied ([#3376](https://github.com/elastic/eui/pull/3376))
Expand Down
21 changes: 13 additions & 8 deletions src/components/basic_table/in_memory_table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,16 +270,21 @@ export class EuiInMemoryTable<T> extends Component<
}

if (
(nextProps.search as EuiSearchBarProps) !==
(nextProps.search as EuiSearchBarProps) &&
ashikmeerankutty marked this conversation as resolved.
Show resolved Hide resolved
(prevState.prevProps.search as EuiSearchBarProps)
) {
return {
prevProps: {
...prevState.prevProps,
search: nextProps.search,
},
query: getQueryFromSearch(nextProps.search, false),
};
const nextQuery = (nextProps.search as EuiSearchBarProps).query;
const prevQuery = (prevState.prevProps.search as EuiSearchBarProps).query;

if (nextQuery !== prevQuery) {
return {
prevProps: {
...prevState.prevProps,
search: nextProps.search,
},
query: getQueryFromSearch(nextProps.search, false),
};
}
}
return null;
}
Expand Down