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

Commit

Permalink
Pass focusVisible option to focus call
Browse files Browse the repository at this point in the history
  • Loading branch information
MidhunSureshR committed Jul 17, 2024
1 parent 1d8ab2a commit 19d83a0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/accessibility/LandmarkNavigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ import { TimelineRenderingType } from "../contexts/RoomContext";
import { Action } from "../dispatcher/actions";
import defaultDispatcher from "../dispatcher/dispatcher";

/**
* In future, browsers will support focusVisible option.
* See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#focusvisible
*/
type ExperimentalFocusAction = FocusOptions & { focusVisible: true };

export const enum Landmark {
// This is the space/home button in the left panel.
ACTIVE_SPACE_BUTTON,
Expand Down Expand Up @@ -67,7 +73,7 @@ export class LandmarkNavigation {
landmark = LandmarkNavigation.getLandmark(landmark, backwards);
element = landmarkToDomElementMap[landmark]();
}
element?.focus();
element?.focus({ focusVisible: true } as ExperimentalFocusAction);
}
}

Expand Down

0 comments on commit 19d83a0

Please sign in to comment.