From 1f0781ca61a38dafd8378c0402f6bf17a425ad5d Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 8 Feb 2022 18:40:39 +0000 Subject: [PATCH] [Release] Inhibit Room List keyboard pass-thru when the search beta is enabled (#7754) --- src/components/structures/LeftPanel.tsx | 1 + src/components/structures/RoomSearch.tsx | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/structures/LeftPanel.tsx b/src/components/structures/LeftPanel.tsx index b9515fef46..c1d04eee32 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(); diff --git a/src/components/structures/RoomSearch.tsx b/src/components/structures/RoomSearch.tsx index 4b58e42ad1..80b50245dd 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");