Add localized aria-labels to glyph buttons #10161
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
MapStore uses a lot of glyph-only buttons with text tooltips. While these tooltips provide
text for the buttons via
aria-labeledby
properties, they are only effective when the tooltipsare being rendered (and the id tying them together is often broken).
This PR proposes a change to the
tooltip
enhancer, which adds the tooltip text asaria-label
to the wrapped buttons.It also refactors some buttons to also use the
tooltip
enhancer, and adds localizedaria-label
sto a few glyph buttons without tooltip.
We would be interested in your opinion whether this is a small enough change to accept, or
whether it introduces unnecessary complexity. However, this is not a high priority issue.
What kind of change does this PR introduce?
Issue
What is the current behavior?
#10158
What is the new behavior?
Most glyph buttons now have a reliably present, localized
aria-label
.Breaking change
Does this PR introduce a breaking change?
Other useful information
Message
component passed astooltip
prop are read out. Maybe this is a little "hacky".ButtonWithTooltip
component) wherever possible seems like a sensible refactoring whether you like thearia-label
change or not. If you do not want to merge this PR, I could do a new one just with this commit.