-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Social Icons: Fix color picker bug when set to Logos Only #38006
Social Icons: Fix color picker bug when set to Logos Only #38006
Conversation
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 for the fix @ndiego 👍
It appears this bug was introduced via the PR (#37067) switching the PanelColorGradientSettings
to use dropdowns. Previously, the ColorGradientControl
would return null when the settings object was missing anything that was required. Wrapping that component within the dropdown without also moving or duplicating those necessary checks gives the empty control in the colors panel.
I wonder if it's possible there might be more cases of this out in the wild. @jorgefilipecosta do you think it is also worth adding a check to the color dropdown generation to guard against this issue?
As for this PR specifically, it does solve the problem for this block.
✅ I could replicate the issue on trunk
✅ After applying these changes the empty control is no longer shown for the logos only block style.
Before | After |
---|---|
@aaronrobertshaw thanks for the approval. So do you think we should merge this or would adding the check to the color picker component be a more appropriate fix? |
Hi @ndiego, thank you for submitting this change I think the change is good regardless of a more general fix. I will look into a more general fix just in case we have other usages we missed. |
@ndiego I was planning to merge this today pending Jorge having a chance to take a look. I see he's already merged which is great. Thanks again for the fix. |
Thanks @aaronrobertshaw! |
Description
When the Social Icons block is set to "Logos Only", the color picker for the Icon Background color should not be shown. Currently it is still shown but with no label and no settings. Basically just an "empty" color picker component is rendered. This PR fixes that by removing the conditional from the color settings array itself.
How has this been tested?
Screenshots
Currently in trunk:
With this PR:
Types of changes
Checklist:
*.native.js
files for terms that need renaming or removal).