Reset truncation when the text box is cleared

pull/21833/head
Kegan Dougal 2016-02-05 16:58:37 +00:00
parent 5dafe1f4a6
commit 7ccce1dc91
1 changed files with 2 additions and 0 deletions

View File

@ -81,6 +81,8 @@ var SearchableEntityList = React.createClass({
var q = ev.target.value; var q = ev.target.value;
this.setState({ this.setState({
query: q, query: q,
// reset truncation if they back out the entire text
truncateAt: (q.length === 0 ? this.props.truncateAt : this.state.truncateAt),
results: this.getSearchResults(q, this.props.entities) results: this.getSearchResults(q, this.props.entities)
}, () => { }, () => {
// invoke the callback AFTER we've flushed the new state. We need to // invoke the callback AFTER we've flushed the new state. We need to