Merge pull request #1977 from matrix-org/t3chguy/ctrl-k_tab

allow using tab to navigate room list in a smarter way
pull/21833/head
Luke Barnard 2018-06-22 10:35:28 +01:00 committed by GitHub
commit f15b877a55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -82,24 +82,26 @@ 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);
break;
case KeyCode.UP:
this._onMoveFocus(true);
handled = true;
break;
case KeyCode.DOWN:
this._onMoveFocus(false);
handled = true;
break;
case KeyCode.ENTER:
this._onMoveFocus(false);
if (this.focusedElement) {
this.focusedElement.click();
}
handled = true;
break;
default:
handled = false;
}
if (handled) {