aria-label on expand / close button

This commit is contained in:
Rachid Mrad 2024-10-18 13:49:09 -04:00
parent 96c77cd476
commit b06ffec6b6
No known key found for this signature in database

View file

@ -1883,11 +1883,13 @@ class MembersTable extends LoadTableBase {
spanElement.textContent = 'Close'; spanElement.textContent = 'Close';
useElement.setAttribute('xlink:href', '/public/img/sprite.svg#expand_less'); useElement.setAttribute('xlink:href', '/public/img/sprite.svg#expand_less');
buttonParentRow.classList.add('hide-td-borders'); buttonParentRow.classList.add('hide-td-borders');
toggleButton.setAttribute('aria-label', 'Close additional information');
} else { } else {
hideElement(contentDiv); hideElement(contentDiv);
spanElement.textContent = 'Expand'; spanElement.textContent = 'Expand';
useElement.setAttribute('xlink:href', '/public/img/sprite.svg#expand_more'); useElement.setAttribute('xlink:href', '/public/img/sprite.svg#expand_more');
buttonParentRow.classList.remove('hide-td-borders'); buttonParentRow.classList.remove('hide-td-borders');
toggleButton.setAttribute('aria-label', 'Expand for additional information');
} }
} }
@ -2080,6 +2082,7 @@ class MembersTable extends LoadTableBase {
type="button" type="button"
class="usa-button--show-more-button usa-button usa-button--unstyled display-block margin-top-1" class="usa-button--show-more-button usa-button usa-button--unstyled display-block margin-top-1"
data-for=${member_id} data-for=${member_id}
aria-label="Expand for additional information"
> >
<span>Expand</span> <span>Expand</span>
<svg class="usa-icon usa-icon--big" aria-hidden="true" focusable="false" role="img" width="24"> <svg class="usa-icon usa-icon--big" aria-hidden="true" focusable="false" role="img" width="24">