Gutenberg: ColorPalette not showing default colors

Created on 28 Jan 2019  路  2Comments  路  Source: WordPress/gutenberg

I just tried using a ColorPalette for my Custom Block Plugin but instead of showing the default colors I have just been able to see the custom color wheel.

Implementation looks like this:
const { ColorPalette } = wp.components
//...
<Fragment>
<InspectorControls>
<PanelBody>
<PanelRow>
<label>My color:</label>
<ColorPalette/>
</PanelRow>
</PanelBody>
</InspectorControls>
<div>
//...
</div>
</Fragment>

And I get this as an output:
error

I would be grateful for any kind of help :)

Most helpful comment

Hi @JustusL, In order to have editor defaults the plugins need to use wp.editor.ColorPalette instead of wp.components.ColorPalette. The wp.components is a low-level version that allows the component user to set its own defaults.
I'm closing the issue for now, if you have additional questions feel free to reopen.

All 2 comments

Hi @JustusL, In order to have editor defaults the plugins need to use wp.editor.ColorPalette instead of wp.components.ColorPalette. The wp.components is a low-level version that allows the component user to set its own defaults.
I'm closing the issue for now, if you have additional questions feel free to reopen.

Hello, I am facing the exact same issue. I tried using wp.editor.ColorPalette and wp.blockEditor.ColorPalette, but the default value is still not being saved.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mhenrylucero picture mhenrylucero  路  3Comments

maddisondesigns picture maddisondesigns  路  3Comments

BE-Webdesign picture BE-Webdesign  路  3Comments

youknowriad picture youknowriad  路  3Comments

maddisondesigns picture maddisondesigns  路  3Comments