mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-22 16:03:25 +00:00
Allow custom focus target for a11y
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
2ac3755120
commit
411d7eca6c
1 changed files with 5 additions and 1 deletions
|
@ -216,7 +216,11 @@ export default class App extends Vue {
|
|||
// Set the focus to the router view
|
||||
// https://marcus.io/blog/accessible-routing-vuejs
|
||||
setTimeout(() => {
|
||||
const focusTarget = this.routerView?.$el as HTMLElement;
|
||||
const focusTarget = (
|
||||
this.routerView?.$refs?.componentFocusTarget !== undefined
|
||||
? this.routerView?.$refs?.componentFocusTarget
|
||||
: this.routerView?.$el
|
||||
) as HTMLElement;
|
||||
if (focusTarget) {
|
||||
// Make focustarget programmatically focussable
|
||||
focusTarget.setAttribute("tabindex", "-1");
|
||||
|
|
Loading…
Reference in a new issue