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

Commit baa3c1e

Browse files
committed
build
1 parent 78186d6 commit baa3c1e

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

build/reactable.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,15 +1191,15 @@ window.ReactDOM["default"] = window.ReactDOM;
11911191
value: function componentWillMount() {
11921192
this.initialize(this.props);
11931193
this.sortByCurrentSort();
1194-
this.filterBy(this.props.filterBy);
1194+
this.filterBy(this.props.filterBy != null ? this.props.filterBy : this.state.filter);
11951195
}
11961196
}, {
11971197
key: 'componentWillReceiveProps',
11981198
value: function componentWillReceiveProps(nextProps) {
11991199
this.initialize(nextProps);
12001200
this.updateCurrentSort(nextProps.sortBy);
12011201
this.sortByCurrentSort();
1202-
this.filterBy(nextProps.filterBy);
1202+
this.filterBy(nextProps.filterBy != null ? nextProps.filterBy : this.state.filter);
12031203
}
12041204
}, {
12051205
key: 'applyFilter',
@@ -1403,7 +1403,7 @@ window.ReactDOM["default"] = window.ReactDOM;
14031403
currentPage = numPages - 1;
14041404
}
14051405

1406-
pagination = true;
1406+
pagination = numPages > 1;
14071407
currentChildren = filteredChildren.slice(currentPage * itemsPerPage, (currentPage + 1) * itemsPerPage);
14081408
}
14091409

lib/reactable/table.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,15 +244,15 @@ var Table = (function (_React$Component) {
244244
value: function componentWillMount() {
245245
this.initialize(this.props);
246246
this.sortByCurrentSort();
247-
this.filterBy(this.props.filterBy);
247+
this.filterBy(this.props.filterBy != null ? this.props.filterBy : this.state.filter);
248248
}
249249
}, {
250250
key: 'componentWillReceiveProps',
251251
value: function componentWillReceiveProps(nextProps) {
252252
this.initialize(nextProps);
253253
this.updateCurrentSort(nextProps.sortBy);
254254
this.sortByCurrentSort();
255-
this.filterBy(nextProps.filterBy);
255+
this.filterBy(nextProps.filterBy != null ? nextProps.filterBy : this.state.filter);
256256
}
257257
}, {
258258
key: 'applyFilter',
@@ -456,7 +456,7 @@ var Table = (function (_React$Component) {
456456
currentPage = numPages - 1;
457457
}
458458

459-
pagination = true;
459+
pagination = numPages > 1;
460460
currentChildren = filteredChildren.slice(currentPage * itemsPerPage, (currentPage + 1) * itemsPerPage);
461461
}
462462

0 commit comments

Comments
 (0)