From 487f3c72dde7641d56d243af2e891982e1f45b7c Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Thu, 2 Jun 2016 16:59:38 +0100 Subject: [PATCH] fix new 3pid invite UI --- .../views/rooms/SearchableEntityList.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) 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} />
);