Skip to content
This repository was archived by the owner on Jan 15, 2022. It is now read-only.

Commit f55f313

Browse files
Fronczwmertens
authored andcommitted
Don't reset filter on update
1 parent 9adf60b commit f55f313

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/reactable/table.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,14 @@ export class Table extends React.Component {
204204
componentWillMount() {
205205
this.initialize(this.props);
206206
this.sortByCurrentSort();
207-
this.filterBy(this.props.filterBy);
207+
this.filterBy(this.props.filterBy != null ? this.props.filterBy : this.state.filter);
208208
}
209209

210210
componentWillReceiveProps(nextProps) {
211211
this.initialize(nextProps);
212212
this.updateCurrentSort(nextProps.sortBy);
213213
this.sortByCurrentSort();
214-
this.filterBy(nextProps.filterBy);
214+
this.filterBy(nextProps.filterBy != null ? nextProps.filterBy : this.state.filter);
215215
}
216216

217217
applyFilter(filter, children) {

0 commit comments

Comments
 (0)