WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.47k stars 4.18k forks source link

Audit usage of explicit `aria-label` on Button component implementations #66271

Open afercia opened 1 day ago

afercia commented 1 day ago

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:

https://github.com/WordPress/gutenberg/blob/91272a2b4bfca1f75a6754a0f3689c3a42988f0c/packages/block-editor/src/components/border-radius-control/linked-button.js#L12-L21

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:

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.

Please confirm that you have tested with all plugins deactivated except Gutenberg.

ciampo commented 1 day ago

Related to https://github.com/WordPress/gutenberg/pull/66021

cc @WordPress/gutenberg-components