Repository navigation
ColorPalette: don't render when custom colors disabled and no colors passed
#72402
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
Changes from 10 commits
4766831
999b0ef
db9e443
6a71646
ba662c7
fdbc438
7d098b5
6ddfc06
ffa793f
a04bdd7
a539cbd
605653c
3834cb7
dc69078
f57c190
3346ca9
83afdd5
f0685e8
3e2e58b
6bcb5db
a01c105
e68122d
df660f4
6265565
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -203,17 +203,19 @@ const BorderControlDropdown = ( | |
| const renderContent = () => ( | ||
| <DropdownContentWrapper paddingSize="medium"> | ||
| <VStack className={ popoverControlsClassName } spacing={ 6 }> | ||
| <ColorPalette | ||
| className={ popoverContentClassName } | ||
| value={ color } | ||
| onChange={ onColorChange } | ||
| { ...{ colors, disableCustomColors } } | ||
| __experimentalIsRenderedInSidebar={ | ||
| __experimentalIsRenderedInSidebar | ||
| } | ||
| clearable={ false } | ||
| enableAlpha={ enableAlpha } | ||
| /> | ||
| { ( colors.length > 0 || ! disableCustomColors ) && ( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should add a test to cover excluding the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @aaronrobertshaw got a test added for that.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the quick iteration @n8finch. Unfortunately, this test doesn't actually cover the change. The guard you added prevents an empty
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @aaronrobertshaw right, ok, there are four tests now covering:
So that will check both sides of the guard now.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @n8finch unfortunately, the tests still do not cover the guards behaviour. The guard prevents rendering the entire Also, I missed this on my earlier review but the tests here are for the |
||
| <ColorPalette | ||
| className={ popoverContentClassName } | ||
| value={ color } | ||
| onChange={ onColorChange } | ||
| { ...{ colors, disableCustomColors } } | ||
| __experimentalIsRenderedInSidebar={ | ||
| __experimentalIsRenderedInSidebar | ||
| } | ||
| clearable={ false } | ||
| enableAlpha={ enableAlpha } | ||
| /> | ||
| ) } | ||
| { enableStyle && isStyleSettable && ( | ||
| <BorderControlStylePicker | ||
| label={ __( 'Style' ) } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.