-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Fix: Impossible to clear colors if color palettes are removed. #37791
Merged
jorgefilipecosta
merged 1 commit into
trunk
from
fix/impossible-to-clear-color-if-palettes-are-removed
Jan 10, 2022
Merged
Fix: Impossible to clear colors if color palettes are removed. #37791
jorgefilipecosta
merged 1 commit into
trunk
from
fix/impossible-to-clear-color-if-palettes-are-removed
Jan 10, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jorgefilipecosta
added
[Type] Bug
An existing feature does not function as intended
Backport to WP Beta/RC
Pull request that needs to be backported to the WordPress major release that's currently in beta
[Feature] Colors
Color management
labels
Jan 7, 2022
jorgefilipecosta
added this to 👀 Needs review
in WordPress 5.9 Must-Haves
via automation
Jan 7, 2022
Size Change: +8 B (0%) Total Size: 1.13 MB
ℹ️ View Unchanged
|
oandregal
approved these changes
Jan 10, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as expected.
Code wise, I'd like to share a couple of thoughts:
clearable
is not used by the leaf components (MultiplePalettes & SinglePalette) so we don't need to pass it to them as a property.- It looks like the core issue is that the MultiplePalettes component does not render its actions when it has no colors while the SingePalette does. What are your thoughts on consolidating how both components work so we don't have to leak implementation details at this level? That it has no colors is only relevant to MultiplePalettes due to its implementation and
clearable
should be the source from which we decide whether the clear button is visible or not.
aristath
approved these changes
Jan 10, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is great!
jorgefilipecosta
deleted the
fix/impossible-to-clear-color-if-palettes-are-removed
branch
January 10, 2022 13:42
jorgefilipecosta
added a commit
that referenced
this pull request
Jan 10, 2022
noisysocks
removed
the
Backport to WP Beta/RC
Pull request that needs to be backported to the WordPress major release that's currently in beta
label
Jan 10, 2022
noisysocks
pushed a commit
that referenced
this pull request
Jan 10, 2022
This was referenced Mar 3, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
If the colors palette are disabled it is impossible to clear a custom color.
This PR fixes the issue and applies the missing logic to colors that was already part of the gradient picker.
How has this been tested?
I disabled all the color palettes by making sure there are no custom colors on the global styles, and adding the following to theme.json under settings.color.
I verified I could set a custom color and the clear button was always available as it was in WordPress 5.8. On trunk the button never appears.
Screenshots