Skip to content

Commit

Permalink
Merge pull request #623 from CuBoulder/issue/614
Browse files Browse the repository at this point in the history
Fixes expandable content `aria-expanded` errors
  • Loading branch information
jnicholCU authored Jan 22, 2024
2 parents 30f7602 + 0ac21d5 commit 9fa1f16
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions templates/block/block--expandable-content.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<div class="accordion-item tab-content">
<h2 class="accordion-header" id="ucb-accordion{{ id }}-title{{ loop.index }}">
{% set expandableHeaderID = item.entity.field_expandable_content_title|view %}
<a id = "{{ item.entity.field_expandable_content_title.value|render|lower|replace({' ': "-"}) }}" class="accordion-button{{ not itemExpanded ? ' collapsed' }} expandableHeaders" type="button" data-bs-toggle="collapse" data-bs-target="#ucb-accordion{{ id }}-content{{ loop.index }}" aria-expanded="{{ itemExpanded ? 'true' : 'false' }}" aria-controls="ucb-accordion{{ id }}-content{{ loop.index }}">
<a id="{{ item.entity.field_expandable_content_title.value|render|lower|replace({' ': "-"}) }}" class="accordion-button{{ not itemExpanded ? ' collapsed' }} expandableHeaders" role="button" data-bs-toggle="collapse" data-bs-target="#ucb-accordion{{ id }}-content{{ loop.index }}" aria-expanded="{{ itemExpanded ? 'true' : 'false' }}" aria-controls="ucb-accordion{{ id }}-content{{ loop.index }}">
<i class="fa-solid fa-square-plus ucb-accordion-button-content-icon-expand"></i><i class="fa-solid fa-square-minus ucb-accordion-button-content-icon-collapse"></i>
{{ item.entity.field_expandable_content_title|view }}
</a>
Expand All @@ -53,7 +53,7 @@
<ul class="nav nav-tabs justify-content-center" id="ucb-horizontal-tabs{{ id }}" role="tablist">
{% for key, item in entity.field_expandable_content_copy %}{% set itemExpanded = loop.first %}
<li class="nav-item" role="presentation">
<a id = "{{ item.entity.field_expandable_content_title.value|render|lower|replace({' ': "-"}) }}" class="nav-link horizontal-tab-link{{ itemExpanded ? ' active' }} expandableHeaders" data-bs-toggle="tab" data-bs-target="#ucb-accordion{{ id }}-content{{ loop.index }}" type="button" role="tab" aria-controls="ucb-accordion{{ id }}-content{{ loop.index }}" aria-selected="{{ itemExpanded ? 'true' : 'false' }}">{{ item.entity.field_expandable_content_title|view }}</a>
<a id="{{ item.entity.field_expandable_content_title.value|render|lower|replace({' ': "-"}) }}" class="nav-link horizontal-tab-link{{ itemExpanded ? ' active' }} expandableHeaders" role="tab" data-bs-toggle="tab" data-bs-target="#ucb-accordion{{ id }}-content{{ loop.index }}" aria-controls="ucb-accordion{{ id }}-content{{ loop.index }}" aria-selected="{{ itemExpanded ? 'true' : 'false' }}">{{ item.entity.field_expandable_content_title|view }}</a>
</li>
{% endfor %}
</ul>
Expand All @@ -65,7 +65,7 @@
<div class="vertical-tab-accordion d-flex align-items-stretch">
<div class="vertical-tabs nav flex-column nav-pills" id="ucb-vertical-tabs{{ id }}" role="tablist" aria-orientation="vertical">
{% for key, item in entity.field_expandable_content_copy %}{% set itemExpanded = loop.first %}
<a id = "{{ item.entity.field_expandable_content_title.value|render|lower|replace({' ': "-"}) }}" class="nav-link vertical-tab-link{{ itemExpanded ? ' active' }} expandableHeaders" data-bs-toggle="pill" data-bs-target="#ucb-accordion{{ id }}-content{{ loop.index }}" type="button" role="tab" aria-controls="ucb-accordion{{ id }}-content{{ loop.index }}" aria-selected="{{ itemExpanded ? 'true' : 'false' }}">{{ item.entity.field_expandable_content_title|view }}</a>
<a id="{{ item.entity.field_expandable_content_title.value|render|lower|replace({' ': "-"}) }}" class="nav-link vertical-tab-link{{ itemExpanded ? ' active' }} expandableHeaders" role="tab" data-bs-toggle="pill" data-bs-target="#ucb-accordion{{ id }}-content{{ loop.index }}" aria-controls="ucb-accordion{{ id }}-content{{ loop.index }}" aria-selected="{{ itemExpanded ? 'true' : 'false' }}">{{ item.entity.field_expandable_content_title|view }}</a>
{% endfor %}
</div>
<div class="vertical-tab-content ">
Expand Down

0 comments on commit 9fa1f16

Please sign in to comment.