Skip to content

Commit 963ba4f

Browse files
MikeListerajhillman-ddj
authored andcommitted
Adding region roles to content sections
1 parent 6eb783f commit 963ba4f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lib/components/ui/Accordion.svelte

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@
152152
<button
153153
type="button"
154154
aria-controls="{section.uniqueid}-content"
155+
id="{section.uniqueid}-button"
155156
class="govuk-accordion__section-button"
156157
aria-expanded={isExpanded}
157158
onclick={() => toggleSection(section.uniqueid)}
@@ -225,6 +226,10 @@
225226
class="govuk-accordion__section-content"
226227
aria-live={ariaLiveValue}
227228
hidden={!isExpanded}
229+
role={uniqueSections.length < 6 ? 'region' : ''}
230+
aria-labelledby={uniqueSections.length < 6
231+
? section.uniqueid + '-button'
232+
: ''}
228233
>
229234
{#if typeof section.content === 'string'}
230235
<p class="govuk-body">{section.content}</p>

0 commit comments

Comments
 (0)