add aria-pressed

This commit is contained in:
BenOsodrac
2025-05-06 17:24:50 +01:00
parent cbe85730fb
commit aadc454cd7

View File

@@ -102,6 +102,7 @@ export class ButtonGroup implements ComponentInterface {
button.size = size;
button.onclick = () => this.handleButtonClick(index, button.getAttribute('value'));
button.classList.toggle('active', index === this.activeIndex);
button.setAttribute('aria-pressed', index === this.activeIndex ? 'true' : 'false');
})}
</Host>
);