From 9c63be7dc445de9eeebde7e3c9844987807a624c Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 23 Oct 2019 18:31:00 +0100
Subject: [PATCH] Remove wrapping div around RoomList to fix regression with
scrollbars
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/components/structures/LeftPanel.js | 38 ++++++++++++++++++--------
src/components/structures/SearchBox.js | 2 ++
src/components/views/rooms/RoomList.js | 12 ++++++--
3 files changed, 39 insertions(+), 13 deletions(-)
diff --git a/src/components/structures/LeftPanel.js b/src/components/structures/LeftPanel.js
index 8a21b017fd..f5687f0595 100644
--- a/src/components/structures/LeftPanel.js
+++ b/src/components/structures/LeftPanel.js
@@ -116,6 +116,20 @@ const LeftPanel = createReactClass({
this.focusedElement = null;
},
+ _onFilterKeyDown: function(ev) {
+ if (!this.focusedElement) return;
+
+ switch (ev.key) {
+ case Key.ENTER: {
+ const firstRoom = ev.target.closest(".mx_LeftPanel").querySelector(".mx_RoomTile");
+ if (firstRoom) {
+ firstRoom.click();
+ }
+ break;
+ }
+ }
+ },
+
_onKeyDown: function(ev) {
if (!this.focusedElement) return;
@@ -255,6 +269,7 @@ const LeftPanel = createReactClass({
enableRoomSearchFocus={true}
blurredPlaceholder={ _t('Filter') }
placeholder={ _t('Filter rooms…') }
+ onKeyDown={this._onFilterKeyDown}
onSearch={ this.onSearch }
onCleared={ this.onSearchCleared }
onFocus={this._onSearchFocus}
@@ -273,18 +288,19 @@ const LeftPanel = createReactClass({