Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

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

Merged
merged 2 commits into from
Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/structures/LeftPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ export default class LeftPanel extends React.Component<IProps, IState> {

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();
Expand Down
5 changes: 4 additions & 1 deletion src/components/structures/RoomSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ export default class RoomSearch extends React.PureComponent<IProps, IState> {
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");
Expand Down