From ff33ef4b5150439f97e9bb21bee9e42e5efa4338 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 16 Jun 2018 08:50:53 +0100 Subject: [PATCH 1/2] allow using tab to navigate room list smarter Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/LeftPanel.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/structures/LeftPanel.js b/src/components/structures/LeftPanel.js index 5acceb1009..7a930fa233 100644 --- a/src/components/structures/LeftPanel.js +++ b/src/components/structures/LeftPanel.js @@ -85,6 +85,10 @@ var LeftPanel = React.createClass({ let handled = false; switch (ev.keyCode) { + case KeyCode.TAB: + this._onMoveFocus(ev.shiftKey); + handled = true; + break; case KeyCode.UP: this._onMoveFocus(true); handled = true; From 423b8939e7c015eadbbe9e778031773b99614ff4 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 16 Jun 2018 08:52:14 +0100 Subject: [PATCH 2/2] simplify handled logic by inverting it Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/LeftPanel.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/structures/LeftPanel.js b/src/components/structures/LeftPanel.js index 7a930fa233..7b115a6c4b 100644 --- a/src/components/structures/LeftPanel.js +++ b/src/components/structures/LeftPanel.js @@ -82,21 +82,20 @@ var LeftPanel = React.createClass({ _onKeyDown: function(ev) { if (!this.focusedElement) return; - let handled = false; + let handled = true; switch (ev.keyCode) { case KeyCode.TAB: this._onMoveFocus(ev.shiftKey); - handled = true; break; case KeyCode.UP: this._onMoveFocus(true); - handled = true; break; case KeyCode.DOWN: this._onMoveFocus(false); - handled = true; break; + default: + handled = false; } if (handled) {