|
154 | 154 | class="govuk-accordion__section-button"
|
155 | 155 | aria-expanded={isExpanded}
|
156 | 156 | onclick={() => toggleSection(section.uniqueid)}
|
157 |
| - aria-label="{section.heading}, {section?.summary}, {isExpanded |
158 |
| - ? hideSectionAriaLabel |
159 |
| - : showSectionAriaLabel}" |
| 157 | + aria-label="{section.heading}, {section.summary |
| 158 | + ? section.summary + ',' |
| 159 | + : ''} {isExpanded ? hideSectionAriaLabel : showSectionAriaLabel}" |
160 | 160 | >
|
161 | 161 | <span class="govuk-accordion__section-heading-text">
|
162 | 162 | <span class="govuk-accordion__section-heading-text-focus"
|
|
197 | 197 | class:govuk-accordion__section--expanded={isExpanded}
|
198 | 198 | >
|
199 | 199 | <div class="govuk-accordion__section-header">
|
200 |
| - {#if headingLevel == 'h2'} |
| 200 | + {#if headingLevel.toLowerCase() == 'h2'} |
201 | 201 | <h2 class="govuk-accordion__section-heading">
|
202 | 202 | {@render content(section, isExpanded)}
|
203 | 203 | </h2>
|
204 |
| - {:else if headingLevel == 'h3'} |
| 204 | + {:else if headingLevel.toLowerCase() == 'h3'} |
205 | 205 | <h3 class="govuk-accordion__section-heading">
|
206 | 206 | {@render content(section, isExpanded)}
|
207 | 207 | </h3>
|
208 |
| - {:else if headingLevel == 'h4'} |
| 208 | + {:else if headingLevel.toLowerCase() == 'h4'} |
209 | 209 | <h4 class="govuk-accordion__section-heading">
|
210 | 210 | {@render content(section, isExpanded)}
|
211 | 211 | </h4>
|
212 |
| - {:else if headingLevel == 'h5'} |
| 212 | + {:else if headingLevel.toLowerCase() == 'h5'} |
213 | 213 | <h5 class="govuk-accordion__section-heading">
|
214 | 214 | {@render content(section, isExpanded)}
|
215 | 215 | </h5>
|
216 |
| - {:else if headingLevel == 'h6'} |
| 216 | + {:else if headingLevel.toLowerCase() == 'h6'} |
217 | 217 | <h6 class="govuk-accordion__section-heading">
|
218 | 218 | {@render content(section, isExpanded)}
|
219 | 219 | </h6>
|
|
222 | 222 | <div
|
223 | 223 | id="{section.uniqueid}-content"
|
224 | 224 | class="govuk-accordion__section-content"
|
225 |
| - aria-labelledby="{section.uniqueid}-heading" |
226 | 225 | aria-live={ariaLiveValue}
|
227 | 226 | hidden={!isExpanded}
|
228 | 227 | >
|
|
0 commit comments