Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Components: Remove unnecessary Tooltip component from linked button #68498

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

im3dabasia
Copy link
Contributor

Fixes: #66271

What?

Quick code quality PR to remove unnecessary usage of the Tooltip component.

Why?

Improve on code quality

How?

Remove Tooltip component and leverage the built-in Button label prop.

Testing Instructions

border-box-control-linked button

  1. Select a Group block.
  2. In the block Settings panel, go to Styles > Border & Shadow
  3. Hover or focus the 'Unlink sides / Link sides' button.
  4. Observe the button tooltip is unchanged: 'Unlink sides' or 'Link sides' depending on the UI state.
  5. Observe the accessible name (aria-label) of the Button is unchanged and matches the tooltip.

spacing-sizes-control linked button

  1. Select a Spacer block.
  2. In the block Settings panel, go to Styles > Dimensions > Margin
  3. Hover or focus the 'Unlink sides / Link sides' button.
  4. Observe the button tooltip is unchanged: 'Unlink sides' or 'Link sides' depending on the UI state.
  5. Observe the accessible name (aria-label) of the Button is unchanged and matches the tooltip.

Screenshots

border-box-control-linked button

Screenshot 2025-01-06 at 11 40 32 AM

spacing-sizes-control linked button

Screenshot 2025-01-06 at 11 57 48 AM

box-control-linked-button (I tested in the in the boxcontrol story)

Screenshot 2025-01-06 at 12 02 44 PM

Copy link

github-actions bot commented Jan 6, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: im3dabasia <[email protected]>
Co-authored-by: ciampo <[email protected]>
Co-authored-by: afercia <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@akasunil akasunil added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Code Quality Issues or PRs that relate to code quality [Package] Components /packages/components labels Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Components /packages/components [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Audit usage of explicit aria-label on Button component implementations
2 participants