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

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
akirk committed Mar 8, 2024
1 parent 03bb366 commit 8e7266f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/structures/LoggedInView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ class LoggedInView extends React.Component<IProps, IState> {
const navAction = getKeyBindingsManager().getNavigationAction(ev);
switch (navAction) {
case KeyBindingAction.NextLandmark:
// The next landmark completes the cycle, back to the active space button.
// When no landmark area is selected, this is reached and we start at the first landmark, the active space button.
document.querySelector<HTMLElement>(".mx_SpaceButton_active")?.focus();
handled = true;
break;
Expand Down
1 change: 1 addition & 0 deletions src/components/structures/MatrixChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
}

private onKeyDown = (e: KeyboardEvent | React.KeyboardEvent): void => {
// Pass up the key event to the parent view (LoggedInView).
this.props.onKeyDown?.(e);

const action = getKeyBindingsManager().getAccessibilityAction(e);
Expand Down
6 changes: 4 additions & 2 deletions src/components/views/rooms/BasicMessageComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -539,11 +539,13 @@ export default class BasicMessageEditor extends React.Component<IProps, IState>
const navAction = getKeyBindingsManager().getNavigationAction(event);
switch (navAction) {
case KeyBindingAction.PreviousLandmark:
document.querySelector(".mx_RoomTile_selected")?.focus();
// The previous landmark is the selected room (we know a room is selected because we're in its message composer).
document.querySelector<HTMLElement>(".mx_RoomTile_selected")?.focus();
handled = true;
break;
case KeyBindingAction.NextLandmark:
document.querySelector(".mx_SpaceButton_active")?.focus();
// The next landmark completes the cycle, back to the active space button.
document.querySelector<HTMLElement>(".mx_SpaceButton_active")?.focus();
handled = true;
break;
}
Expand Down

0 comments on commit 8e7266f

Please sign in to comment.