material-table
material-table copied to clipboard
SearchText reset when parent component renders
Describe the bug The search box gets cleared if the parent component of a table gets rendered. For example, when a useState hook is triggered.
To Reproduce Steps to reproduce the behavior:
- Create a component with a useState hook and MaterialTable as a child
- Type in a search term in the table's search box
- Trigger the hook
- See that search text gets cleared, along with resetting table results
Expected behavior The search text is persisted on renders of parent component
Screenshots

Desktop (please complete the following information):
- OS: Windows 10
- Browser: Chrome
- Version 78.0.3904.70
Additional context
This seems to be related to pull request #1225. I tested by changing line 64 of material-table.js to props.options.searchText && this.dataManager.changeSearchText(props.options.searchText); and the search text was persisted.
edit: specify useState hook
Closing since this should've been fixed with PR #1298