From 2bcb381aa73201b3c5d1e0bb8ab9cf04816535c6 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 27 May 2017 14:19:34 +0100 Subject: [PATCH 1/2] maybe window focus should be ignored so focus is left as what it was but with this at least clicking on a text input will not make you be thrown into composer instead Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/MatrixChat.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 0de38ab226..a4b6b3ea6c 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -906,7 +906,9 @@ module.exports = React.createClass({ }, onFocus: function(ev) { - dis.dispatch({action: 'focus_composer'}); + if (document.activeElement.textLength === undefined) { + dis.dispatch({action: 'focus_composer'}); + } }, showScreen: function(screen, params) { From 4cd7964b584bf88e4cf3e6cb6438b2c592324478 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 27 May 2017 18:43:59 +0100 Subject: [PATCH 2/2] remove window onFocus handling entirely Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/MatrixChat.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 6638431410..4b05d746f3 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -247,7 +247,6 @@ module.exports = React.createClass({ UDEHandler.startListening(); this.focusComposer = false; - window.addEventListener("focus", this.onFocus); // this can technically be done anywhere but doing this here keeps all // the routing url path logic together. @@ -910,12 +909,6 @@ module.exports = React.createClass({ }); }, - onFocus: function(ev) { - if (document.activeElement.textLength === undefined) { - dis.dispatch({action: 'focus_composer'}); - } - }, - showScreen: function(screen, params) { if (screen == 'register') { dis.dispatch({