diff --git a/src/components/views/rooms/SearchableEntityList.js b/src/components/views/rooms/SearchableEntityList.js index 28e7b1785c..a22126025c 100644 --- a/src/components/views/rooms/SearchableEntityList.js +++ b/src/components/views/rooms/SearchableEntityList.js @@ -129,14 +129,26 @@ var SearchableEntityList = React.createClass({ render: function() { var inputBox; - + if (this.props.showInputBox) { inputBox = (
{ this.setState({ focused: true }) } } - onBlur={ ()=>{ this.setState({ focused: false }) } } + onFocus={ ()=>{ + if (this._blurTimeout) { + clearTimeout(this.blurTimeout); + } + this.setState({ focused: true }); + } } + onBlur={ ()=>{ + // nasty setTimeout heuristic to avoid the 'invite by email' prompt disappearing + // due to the onBlur before we can click on it + this._blurTimeout = setTimeout( + ()=>{ this.setState({ focused: false }) }, + 300 + ); + } } placeholder={this.props.searchPlaceholderText} />
);