Fix aria-labelledby attributes

pull/186/head
Cory LaViska 2020-08-20 09:12:13 -04:00
rodzic ee41a71ccd
commit 21889924e7
9 zmienionych plików z 10 dodań i 10 usunięć

Wyświetl plik

@ -52,7 +52,7 @@
pre.id = preId;
pre.classList.add('code-block__source');
pre.setAttribute('data-lang', pre.getAttribute('data-lang').replace(/ preview$/, ''));
pre.setAttribute('aria-labeledby', toggleId);
pre.setAttribute('aria-labelledby', toggleId);
toggle.id = toggleId;
toggle.type = 'button';

Wyświetl plik

@ -156,7 +156,7 @@ export class Checkbox {
value={this.value}
checked={this.checked}
disabled={this.disabled}
aria-labeledby={this.labelId}
aria-labelledby={this.labelId}
onClick={this.handleClick}
onBlur={this.handleBlur}
onFocus={this.handleFocus}

Wyświetl plik

@ -203,7 +203,7 @@ export class Details {
id={`${this.componentId}-content`}
class="details__content"
role="region"
aria-labeledby={`${this.componentId}-header`}
aria-labelledby={`${this.componentId}-header`}
>
<slot />
</div>

Wyświetl plik

@ -209,7 +209,7 @@ export class Dialog {
aria-modal="true"
aria-hidden={!this.open}
aria-label={this.noHeader ? this.label : null}
aria-labeledby={!this.noHeader ? `${this.componentId}-title` : null}
aria-labelledby={!this.noHeader ? `${this.componentId}-title` : null}
tabIndex={0}
>
{!this.noHeader && (

Wyświetl plik

@ -228,7 +228,7 @@ export class Drawer {
aria-modal="true"
aria-hidden={!this.open}
aria-label={this.noHeader ? this.label : null}
aria-labeledby={!this.noHeader ? `${this.componentId}-title` : null}
aria-labelledby={!this.noHeader ? `${this.componentId}-title` : null}
tabIndex={0}
>
{!this.noHeader && (

Wyświetl plik

@ -296,7 +296,7 @@ export class Dropdown {
class="dropdown__panel"
role="menu"
aria-hidden={!this.open}
aria-labeledby={this.componentId}
aria-labelledby={this.componentId}
hidden
>
<slot />

Wyświetl plik

@ -162,7 +162,7 @@ export class Radio {
value={this.value}
checked={this.checked}
disabled={this.disabled}
aria-labeledby={this.labelId}
aria-labelledby={this.labelId}
onClick={this.handleClick}
onBlur={this.handleBlur}
onFocus={this.handleFocus}

Wyświetl plik

@ -130,7 +130,7 @@ export class Switch {
value={this.value}
checked={this.checked}
disabled={this.disabled}
aria-labeledby={this.labelId}
aria-labelledby={this.labelId}
onClick={this.handleClick}
onBlur={this.handleBlur}
onFocus={this.handleFocus}

Wyświetl plik

@ -79,7 +79,7 @@ export class TabGroup {
this.mutationObserver = new MutationObserver(mutations => {
if (
mutations.some(mutation => {
return !['aria-labeledby', 'aria-controls'].includes(mutation.attributeName);
return !['aria-labelledby', 'aria-controls'].includes(mutation.attributeName);
})
) {
setTimeout(() => this.setAriaLabels());
@ -223,7 +223,7 @@ export class TabGroup {
const panel = panels.find(el => el.name === tab.panel);
if (panel) {
tab.setAttribute('aria-controls', panel.getAttribute('id'));
panel.setAttribute('aria-labeledby', tab.getAttribute('id'));
panel.setAttribute('aria-labelledby', tab.getAttribute('id'));
}
});
}