mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2025-10-16 11:55:39 +00:00
Merge pull request #489 from react-bootstrap-table/bugfix/infinite-remote-search
Bugfix/infinite remote search
This commit is contained in:
commit
cb49455a4e
@ -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;
|
||||
}
|
||||
|
||||
@ -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",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user