Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

allow using tab to navigate room list in a smarter way #1977

Merged
merged 3 commits into from
Jun 22, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/components/structures/LeftPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down