Skip to content

Commit

Permalink
fix: Accordion aria-label (#347)
Browse files Browse the repository at this point in the history
* fix: Accordion aria-label

* fix: same for accordion component

---------

Co-authored-by: Niclas Norin <niclas.norin@helsingborg.se>
  • Loading branch information
NiclasNorin and Niclas Norin authored Nov 6, 2023
1 parent 65e5f2a commit f325642
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions source/php/Component/Accordion/accordion.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
@if($list)
<{{$componentElement}} class="{{ $class }}" js-expand-container {!! $attribute !!}>
@foreach($list as $section)
<{{$sectionElement}} class="{{$baseClass}}__section" aria-label="{{$section['heading']}}">
<{{$sectionElement}} class="{{$baseClass}}__section">

<{{$sectionHeadingElement}} class="{{$baseClass}}__button" role="button" aria-controls="{{ $baseClass }}__aria-{{ $id }}-{{ $loop->index }}" aria-expanded="false" js-expand-button>
<{{$sectionHeadingElement}} class="{{$baseClass}}__button" role="button" aria-label="{{$section['heading']}}" aria-controls="{{ $baseClass }}__aria-{{ $id }}-{{ $loop->index }}" aria-expanded="false" js-expand-button>
<span class="{{$baseClass}}__button-wrapper" tabindex="-1">
{!!$beforeHeading!!}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{-- Accordion Item --}}
<{{$sectionElement}} class="{{$class}}" {!! $attribute !!} aria-label="{{$heading}}">
<{{$sectionHeadingElement}} class="{{$baseClass}}__button" aria-controls="{{ $baseClass }}__aria-{{ $id }}" aria-expanded="false" js-expand-button href="#{{$id}}">
<{{$sectionElement}} class="{{$class}}" {!! $attribute !!}">
<{{$sectionHeadingElement}} class="{{$baseClass}}__button" aria-label="{{$heading}} aria-controls="{{ $baseClass }}__aria-{{ $id }}" aria-expanded="false" js-expand-button href="#{{$id}}">
<span class="{{$baseClass}}__button-wrapper {{$headingType}} " tabindex="-1">

{!!$beforeHeading!!}
Expand Down

0 comments on commit f325642

Please sign in to comment.