From a73e284259c7c0d0b32dbc9c858eca926450dc0a Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 8 Feb 2022 17:16:37 +0000 Subject: [PATCH 1/2] Inhibit Room List keyboard pass-thru when the search beta is enabled --- src/components/structures/LeftPanel.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/structures/LeftPanel.tsx b/src/components/structures/LeftPanel.tsx index b9515fef465..c1d04eee32b 100644 --- a/src/components/structures/LeftPanel.tsx +++ b/src/components/structures/LeftPanel.tsx @@ -317,6 +317,7 @@ export default class LeftPanel extends React.Component { private onRoomListKeydown = (ev: React.KeyboardEvent) => { if (ev.altKey || ev.ctrlKey || ev.metaKey) return; + if (SettingsStore.getValue("feature_spotlight")) return; // we cannot handle Space as that is an activation key for all focusable elements in this widget if (ev.key.length === 1) { ev.preventDefault(); From 13b5235e8d4bad11b88b77ba2b53b93ce71584fa Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 8 Feb 2022 17:17:09 +0000 Subject: [PATCH 2/2] Clear any room list query when toggling search beta --- src/components/structures/RoomSearch.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/structures/RoomSearch.tsx b/src/components/structures/RoomSearch.tsx index 4b58e42ad19..80b50245dd4 100644 --- a/src/components/structures/RoomSearch.tsx +++ b/src/components/structures/RoomSearch.tsx @@ -96,7 +96,10 @@ export default class RoomSearch extends React.PureComponent { private onSpotlightChange = () => { const spotlightBetaEnabled = SettingsStore.getValue("feature_spotlight"); if (this.state.spotlightBetaEnabled !== spotlightBetaEnabled) { - this.setState({ spotlightBetaEnabled }); + this.setState({ + spotlightBetaEnabled, + query: "", + }); } // in case the user was in settings at the 5-minute mark, dismiss the toast ToastStore.sharedInstance().dismissToast("BETA_SPOTLIGHT_TOAST");