Skip to content

Commit

Permalink
add searchDelayTime props
Browse files Browse the repository at this point in the history
  • Loading branch information
madeinfree committed Mar 25, 2016
1 parent 5401d4c commit 8dc6436
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/BootstrapTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ class BootstrapTable extends Component {
<div className='react-bs-table-tool-bar'>
<ToolBar
clearSearch={ this.props.options.clearSearch }
searchDelayTime={ this.props.options.searchDelayTime }
enableInsert={ insertRow }
enableDelete={ deleteRow }
enableSearch={ search }
Expand Down
3 changes: 2 additions & 1 deletion src/toolbar/ToolBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,11 @@ class ToolBar extends Component {
}

handleKeyUp = () => {
const delay = this.props.searchDelayTime ? this.props.searchDelayTime : 0;
this.handleDebounce(() => {
this.props.onSearch(this.refs.seachInput.value);
},
500
delay
)();
}

Expand Down

0 comments on commit 8dc6436

Please sign in to comment.