fix: aria-describedby isn't recognized by SRs in fast-button #6442
Labels
area:fast-foundation
Pertains to fast-foundation
breaking-change
A breaking change to a shipping package
bug
A bug
closed:obsolete
No longer valid
community:request
Issues specifically reported by a member of the community.
compliance:a11y
Accessibility compliance.
status:planned
Work is planned
🐛 Bug Report
When a user adds the
aria-describedby
attribute and value to thefast-button
element, the attribute appears on both thefast-button
element and itsbutton
child element. This dual use appears to break thearia-describedby
functionality. This is an important for screen readers, which usearia-describedby
to tie a focusable element, such as abutton
, to another element that contains important additional information.A good use case for this is the
fast-tooltip
component. Someone creating an accessibletooltip
needs to programatically bind thefast-tooltip
to the element that thefast-tooltip
is providing more information for. This is done througharia-describedby
, but it is not working if I addaria-describedby
to thefast-button
element. However, If I addaria-describedby
to simplebutton
element, and tie it to the id offast-tooltip
, it is read by a screen reader.This may be a broader issue for focusable elements:
fast-anchor
,fast-checkbox
, etc, and for otheraria-
attributes. I've only testedaria-describedby
with thefast-tooltip
andfast-button
components.This is a similar issue to #6041.
💻 Repro or Code Sample
fast-tooltip
id
to the tooltiparia-describedby
to thefast-button
element, make its value equal to thetooltip id
aria-describedby
attribute is present on thefast-button
element and itsbutton
childfast-button
. You will not hear thetooltip
content announcedfast-button
withbutton
in the code editor, while keeping thearia-describedby
attribute on the buttonbutton
. You should hear thetooltip
content read aloud🤔 Expected Behavior
A user who needs to add additional information to a
fast-button
or other focusable element should be able to addaria-describedby
as an attribute with a value, or pass a value to a prop, and have the contents of the bindeded element read aloud by a screenreader when thefast-button
is being focused upon.😯 Current Behavior
If a user attaches

aria-describedby
as an attribute tofast-button
, the attribute appears on both thefast-button
element and itsbutton
child. A screenreader does not read the tooltip content.However, if a user attaches the same attribute to a

button
element and runs the screen reader, thefast-tooltip
content is read aloud.💁 Possible Solution
I'm new to FAST, but a possible solution would be to add an option to
fast-button
and other focusable elements that allows users to pass anaria-describedby
value as aprop
, which is then added as anattribute
to theshadow root
child, in this casebutton
.🔦 Context
This issue has serious accessibility implications. A focusable element that requires additional information needs an
aria-desciribedby
attribute that is binded to theid
of an element that is providing additional information. Thefast-tooltip
component is a perfect example, because its purpose is to provide additional information to a focusable element.If there is no bind between the focusable element and the element that holds the additional info that describes it - or, as in this case, if the bind isn't working - screen readers will not know the two are connected, and will not read the additional information when the focusable element is being interacted with.
🌍 Your Environment
The text was updated successfully, but these errors were encountered: