Skip to content

Commit

Permalink
Deploying to gh-pages from @ 9fa0164 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
oisa committed Dec 9, 2024
1 parent 14549e0 commit 6ffc5c7
Show file tree
Hide file tree
Showing 4 changed files with 175 additions and 171 deletions.
1 change: 0 additions & 1 deletion components/accordion/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,6 @@ <h2>Principles</h2>
<h2>Accessibility</h2>
<p>All components are responsive and designed to comply with WCAG 2.2 AA accessibility standards. Full compliance depends on using and configuring the components correctly.</p>


</div>
</section>
<section id="section-interactive-demo" class="nsw-tabs__content">
Expand Down
1 change: 0 additions & 1 deletion components/content-block/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@ <h2>How this component works</h2>
<h2>Accessibility</h2>
<p>All components are responsive and designed to comply with WCAG 2.2 AA accessibility standards. Full compliance depends on using and configuring the components correctly.</p>


</div>
</section>
<section id="section-interactive-demo" class="nsw-tabs__content">
Expand Down
8 changes: 7 additions & 1 deletion js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4219,6 +4219,11 @@
ariaExpanded = this.trigger.getAttribute('aria-expanded') === 'true' ? 'false' : 'true';
}
this.trigger.setAttribute('aria-expanded', ariaExpanded);
const options = this.dropdown.querySelectorAll(`.js-${this.optionClass}`);
options.forEach(option => {
const isVisible = ariaExpanded === 'true';
option.setAttribute('aria-hidden', !isVisible);
});
if (ariaExpanded === 'true') {
const selectedOption = this.getSelectedOption() || this.allButton;
this.constructor.moveFocusFn(selectedOption);
Expand Down Expand Up @@ -4387,7 +4392,8 @@
const disabled = options[i].hasAttribute('disabled') ? 'disabled' : '';
const checked = options[i].hasAttribute('selected') ? 'checked' : '';
const uniqueName = this.constructor.createSafeCss(`${this.selectId}-${options[i].value}-${this.optionIndex.toString()}`);
list = `${list}<li class="js-${this.optionClass}" role="option" data-value="${options[i].value}" ${selected} data-label="${options[i].text}" data-index="${this.optionIndex}"><input aria-hidden="true" class="${this.prefix}${this.checkboxInputClass} js-${this.checkboxClass}" type="checkbox" id="${uniqueName}" ${checked} ${disabled}><label class="${this.prefix}${this.checkboxLabelClass} ${this.prefix}${this.itemClass} ${this.prefix}${this.itemClass}--option" aria-hidden="true" for="${uniqueName}"><span>${options[i].text}</span></label></li>`;
const ariaHidden = options[i].hasAttribute('hidden') ? 'aria-hidden="true"' : '';
list = `${list}<li class="js-${this.optionClass}" role="option" data-value="${options[i].value}" ${selected} ${ariaHidden} data-label="${options[i].text}" data-index="${this.optionIndex}"><input class="${this.prefix}${this.checkboxInputClass} js-${this.checkboxClass}" type="checkbox" id="${uniqueName}" ${checked} ${disabled}><label class="${this.prefix}${this.checkboxLabelClass} ${this.prefix}${this.itemClass} ${this.prefix}${this.itemClass}--option" for="${uniqueName}"><span>${options[i].text}</span></label></li>`;
this.optionIndex += 1;
}
return list;
Expand Down
Loading

0 comments on commit 6ffc5c7

Please sign in to comment.