55 id =" header"
66 class =" text-black"
77 >
8- <a
9- class =" skip-to-main-content-link"
10- href =" #main"
8+ <div
119 id =" skipToMain"
12- v-on:blur =" skipToMainFocused = false"
13- v-on:click.prevent =" focusMain"
14- v-on:focus =" skipToMainFocused = true"
1510 >
16- Skip to main content
17- </a >
11+ <a
12+ v-for =" skipLink in skipLinks"
13+ class =" skip-to-main-content-link"
14+ v-bind:key =" skipLink.id"
15+ v-bind:href =" `#${skipLink.id}`"
16+ v-on:blur =" skipToMainFocused = false"
17+ v-on:click.prevent =" focusElement(skipLink.id)"
18+ v-on:focus =" skipToMainFocused = true"
19+ >
20+ Skip to {{ skipLink.where }}
21+ </a >
22+ </div >
1823 <Header
1924 v-bind:show-open-preview-button =" isPreviewDrawer"
2025 />
2429 <q-page
2530 id =" main"
2631 role =" main"
27- tabindex =" 0"
2832 v-bind:class =" isMainConnected ? '' : 'q-pa-md'"
2933 >
3034 <div v-bind:class =" ['row', 'justify-center', isMainConnected ? '' : 'q-pa-md q-ml-auto']" >
3135 <div
3236 id =" main-block"
3337 v-bind:class =" ['row', 'col', 'bg-white', 'q-pa-md', isMainConnected ? '' : 'elevated rounded-borders q-mx-lg']"
3438 >
35- <aside class =" col-auto gt-xs" >
39+ <aside
40+ class =" col-auto gt-xs"
41+ id =" stepper"
42+ tabindex =" 0"
43+ >
3644 <Stepper />
3745 </aside >
38- <div
39- id =" form"
46+ <form
4047 class =" col column"
48+ id =" form"
49+ tabindex =" 0"
4150 >
4251 <div id =" form-content" >
4352 <router-view />
6069 no-caps
6170 v-on:click =" togglePreview"
6271 />
63- </div >
72+ </form >
6473 </div >
6574 <component
6675 v-if =" !isOnlyForm"
@@ -136,8 +145,8 @@ export default defineComponent({
136145 isPreviewDrawerOpen .value = false
137146 }
138147 return {
139- focusMain : () => {
140- const element = window .document .getElementById (' main ' )
148+ focusElement : (id : string ) => {
149+ const element = window .document .getElementById (id )
141150 if (! element ) return
142151 element .focus ()
143152 },
@@ -149,6 +158,10 @@ export default defineComponent({
149158 isPreviewDrawerOpen ,
150159 isPreviewDrawer: computed (() => q .screen .sm || q .screen .md ),
151160 isMainConnected: computed (() => q .screen .xs || q .screen .sm ),
161+ skipLinks: [
162+ { id: ' form' , where: ' main content' },
163+ { id: ' stepper' , where: ' stepper navigation' }
164+ ],
152165 skipToMainFocused: ref (false ),
153166 onResize ,
154167 togglePreview : () => {
0 commit comments