Carbon: Notifications close button: aria-label should be on button, not on svg child

Created on 19 Oct 2018  路  3Comments  路  Source: carbon-design-system/carbon

Notifications have a close button that has an svg child for the little x icon.

Currently, the svg child has the aria-label="close", but the aria-label needs to be on the interactive element - i.e. the button - in order to work in all screen readers.

image

dev 馃 bug 馃悰

Most helpful comment

@joshblack

Just curious, why does DAP report this as a form control when in this context?

Agreed that it's a bit odd. I suspect the DAP may just be using a standard rule here that checks all form controls following the Name And Description Computation algorithm.

I believe the original implementation placed the aria-label on svg so that it would be read as the content when button was focused on by a screenreader.

Yes, and I think that would usually work, because the way I read the current name computation algorithm, the aria-label on the svg would "bubble up" to the button. However I believe this wasn't always the case, and the DAP is being conservative in requiring the aria-label to be on the interactive element so that it will work in all screen readers.

All 3 comments

Thanks for the report @carmacleod! Added a PR to move it over.

Just curious, why does DAP report this as a form control when in this context? I believe the original implementation placed the aria-label on svg so that it would be read as the content when button was focused on by a screenreader.

:tada: This issue has been resolved in version 9.32.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

@joshblack

Just curious, why does DAP report this as a form control when in this context?

Agreed that it's a bit odd. I suspect the DAP may just be using a standard rule here that checks all form controls following the Name And Description Computation algorithm.

I believe the original implementation placed the aria-label on svg so that it would be read as the content when button was focused on by a screenreader.

Yes, and I think that would usually work, because the way I read the current name computation algorithm, the aria-label on the svg would "bubble up" to the button. However I believe this wasn't always the case, and the DAP is being conservative in requiring the aria-label to be on the interactive element so that it will work in all screen readers.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jhpedemonte picture jhpedemonte  路  3Comments

ajdaniel picture ajdaniel  路  3Comments

windgaucho picture windgaucho  路  3Comments

antonmc picture antonmc  路  3Comments

AnthumChris picture AnthumChris  路  3Comments