[Release] Inhibit Room List keyboard pass-thru when the search beta is enabled (#7754)

pull/21833/head
Michael Telatynski 2022-02-08 18:40:39 +00:00 committed by GitHub
parent eb72199808
commit 1f0781ca61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -317,6 +317,7 @@ export default class LeftPanel extends React.Component<IProps, IState> {
private onRoomListKeydown = (ev: React.KeyboardEvent) => { private onRoomListKeydown = (ev: React.KeyboardEvent) => {
if (ev.altKey || ev.ctrlKey || ev.metaKey) return; 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 // we cannot handle Space as that is an activation key for all focusable elements in this widget
if (ev.key.length === 1) { if (ev.key.length === 1) {
ev.preventDefault(); ev.preventDefault();

View File

@ -96,7 +96,10 @@ export default class RoomSearch extends React.PureComponent<IProps, IState> {
private onSpotlightChange = () => { private onSpotlightChange = () => {
const spotlightBetaEnabled = SettingsStore.getValue("feature_spotlight"); const spotlightBetaEnabled = SettingsStore.getValue("feature_spotlight");
if (this.state.spotlightBetaEnabled !== spotlightBetaEnabled) { 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 // in case the user was in settings at the 5-minute mark, dismiss the toast
ToastStore.sharedInstance().dismissToast("BETA_SPOTLIGHT_TOAST"); ToastStore.sharedInstance().dismissToast("BETA_SPOTLIGHT_TOAST");