From 7ccce1dc91f910e9797ed15b3289e934e485f9ea Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Fri, 5 Feb 2016 16:58:37 +0000 Subject: [PATCH] Reset truncation when the text box is cleared --- src/components/views/rooms/SearchableEntityList.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/views/rooms/SearchableEntityList.js b/src/components/views/rooms/SearchableEntityList.js index acd20f3984..c91e058e4c 100644 --- a/src/components/views/rooms/SearchableEntityList.js +++ b/src/components/views/rooms/SearchableEntityList.js @@ -81,6 +81,8 @@ var SearchableEntityList = React.createClass({ var q = ev.target.value; this.setState({ 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) }, () => { // invoke the callback AFTER we've flushed the new state. We need to