mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 19:56:47 +03:00
Handle LEFT Arrow as expected by Aria Treeview Widget pattern
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
f72ff95efb
commit
fe46925c00
1 changed files with 9 additions and 5 deletions
|
@ -133,6 +133,13 @@ const RoomSubList = createReactClass({
|
||||||
// Prevent LeftPanel handling Tab if focus is on the sublist header itself
|
// Prevent LeftPanel handling Tab if focus is on the sublist header itself
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
break;
|
break;
|
||||||
|
case Key.ARROW_LEFT:
|
||||||
|
// On ARROW_LEFT collapse the room sublist
|
||||||
|
if (!this.state.hidden && !this.props.forceExpand) {
|
||||||
|
this.onClick();
|
||||||
|
}
|
||||||
|
ev.stopPropagation();
|
||||||
|
break;
|
||||||
case Key.ARROW_RIGHT: {
|
case Key.ARROW_RIGHT: {
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
if (this.state.hidden && !this.props.forceExpand) {
|
if (this.state.hidden && !this.props.forceExpand) {
|
||||||
|
@ -181,14 +188,11 @@ const RoomSubList = createReactClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
onKeyDown: function(ev) {
|
onKeyDown: function(ev) {
|
||||||
// On ARROW_LEFT collapse the room sublist
|
// On ARROW_LEFT go to the sublist header
|
||||||
if (ev.key === Key.ARROW_LEFT) {
|
if (ev.key === Key.ARROW_LEFT) {
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
if (!this.state.hidden && !this.props.forceExpand) {
|
|
||||||
this.onClick();
|
|
||||||
this._headerButton.current.focus();
|
this._headerButton.current.focus();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onRoomTileClick(roomId, ev) {
|
onRoomTileClick(roomId, ev) {
|
||||||
|
|
Loading…
Reference in a new issue