Skip to content

Fix: Focus loss when “Clear” button is used in Styles > Color#69097

Open
Rishit30G wants to merge 5 commits into
WordPress:trunkfrom
Rishit30G:fix/focus-loss-when-clear-button-clicked
Open

Fix: Focus loss when “Clear” button is used in Styles > Color#69097
Rishit30G wants to merge 5 commits into
WordPress:trunkfrom
Rishit30G:fix/focus-loss-when-clear-button-clicked

Conversation

@Rishit30G

@Rishit30G Rishit30G commented Feb 7, 2025

Copy link
Copy Markdown
Contributor

What?

Closes #60614

Why?

This PR is intended solve the issue that occurs when the user clicks on "Clear" in the style and the focus from the component losses resulting in stack of popovers if other options are opened

How?

This PR adds a check !userValue to colorValue prop

Testing Instructions

In the Site Editor
Go to Styles > Colors
Change a color to something other than the default
Use the “Clear” button
Notice focus is lost (palette dropdown doesn’t close as expected or if you are using the keyboard you're nowhere near where you were)

Screenshots or screencast

Before

Screen.Recording.2025-02-06.at.7.01.34.PM.mov

After

Screen.Recording.2025-04-09.at.11.41.33.AM.mov

@Rishit30G Rishit30G requested a review from ajitbohra as a code owner February 7, 2025 13:33
@github-actions

github-actions Bot commented Feb 7, 2025

Copy link
Copy Markdown

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: Rishit30G <rishit30g@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: stokesman <presstoke@git.wordpress.org>

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

@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). labels Feb 8, 2025
@Rishit30G Rishit30G requested a review from ellatrix as a code owner February 12, 2025 10:23
@Rishit30G Rishit30G requested review from nerrad and ntwb as code owners April 9, 2025 05:25
@Rishit30G Rishit30G force-pushed the fix/focus-loss-when-clear-button-clicked branch from 648efaf to 941f88d Compare April 9, 2025 05:26
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). [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Focus loss when “Clear” button is used in Styles > Color

2 participants