Merge pull request #489 from react-bootstrap-table/bugfix/infinite-remote-search

Bugfix/infinite remote search
This commit is contained in:
Allen 2018-08-15 23:16:52 +08:00 committed by GitHub
commit cb49455a4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 3 deletions

View File

@ -20,11 +20,26 @@ export default (options = {
searchText: PropTypes.string
}
constructor(props) {
super(props);
this.performRemoteSearch = props.searchText !== '';
}
componentWillReceiveProps(nextProps) {
if (isRemoteSearch()) {
if (nextProps.searchText !== this.props.searchText) {
this.performRemoteSearch = true;
} else {
this.performRemoteSearch = false;
}
}
}
search() {
const { data, columns } = this.props;
let { searchText } = this.props;
if (isRemoteSearch()) {
if (isRemoteSearch() && this.performRemoteSearch) {
handleRemoteSearchChange(searchText);
return data;
}

View File

@ -1,6 +1,6 @@
{
"name": "react-bootstrap-table-next",
"version": "1.1.0",
"version": "1.1.1",
"description": "Next generation of react-bootstrap-table",
"main": "./lib/index.js",
"repository": {
@ -36,7 +36,8 @@
}
],
"dependencies": {
"classnames": "2.2.5"
"classnames": "2.2.5",
"underscore": "1.9.1"
},
"peerDependencies": {
"classnames": "^2.2.5",