Closed mbohal closed 4 months ago
The invisible label does remain accessible:
FF dev tools:
What you probably mean is the button does not provide any textual alternative to sighted users. In such case this is what you would do:
title
attribute (which may be annoying for AT users as both texts are announced: "My action, Title description, button", or something like that), orTo sum it up, current behavior is correct. But I'll be happy to implement a Tooltip
component which could be paired with Button
s to improve the UX while not putting accessibility at stake.
What you probably mean is the button does not provide any textual alternative to sighted users.
Yes, that is what I had in mind.
Lets go with option 1). When we will have the component <Tooltip>
we can use it here. We do not have the capacity to implement <Tooltip>
at this point.
Then I suggest putting something like this into the docs:
For icon-only buttons, consider using the title
attribute to provide a textual alternative.
OK?
@adamkudrna
I think there are two ways to solve this:
label
and title
propstitle
if provided or use the text passed in via the label
prop if not providedI think I prefer 2) developers (e.g. myself) will keep forgetting to pass in the title
. Are there any arguments why 1) would be a better idea?
The docs will be updated in the General guidelines
section.
When mentioning the option to add title
it should be mentioned that it will lead to aria reader a duplicit description.
… but apparently, they don't implement it:
The reason probably is that in Spectrum they pass the button label as children so it's not easy/possible to find out if a label is rendered or not.
When the
<Button>
component is rendered withlabelVisbility
set tonone
or to value smaller the current viewport thelabel
value is not accessible.I think it should appear on mouse hover.