Open
Description
openedon Oct 21, 2024
Description
It appears that in some cases some Button
components use an explicit aria-label
prop to render an aria-label
HTML attribute, which in turn determines the icon button tooltip (if it's an icon button). Example:
This pattern should be audited across the entire codebase as it's not a best practice.
Setting an explicit aria-label
signals two possible cases, both less than ideal:
- The
aria-label
is used in a way that the accessible name mismatches the Button text or tooltip. This is not OK for accessibility. - The
aria-label
is just unnecessary, like in the example above. In that case, the wrapping Tooltip component uses the samelabel
variable used foraria-label
. In this case, the Tooltip component can be removed and the variable passed to thelabel
prop of the Butotn.
Step-by-step reproduction instructions
N/A
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
- Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- Yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment