Skip to content

Commit

Permalink
Wrap ColorPicker in BaseControl for label.
Browse files Browse the repository at this point in the history
  • Loading branch information
pdclark authored and sc0ttkclark committed Jun 17, 2024
1 parent be0ca38 commit 8ac165d
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions ui/js/blocks/src/blocks/components/RenderedField.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,24 @@ const RenderedField = ( {
);
}
case 'ColorPicker': {
const {
label,
} = fieldOptions;
const instanceId = useInstanceId( ColorPicker );
const id = `inspector-color-control-${ instanceId }`;

return (
<ColorPicker
color={ fieldValue }
onChangeComplete={ ( value ) => changeHandler( value.hex ) }
disableAlpha
/>
<BaseControl
label={ label }
id={ id }
key={ name }
>
<ColorPicker
color={ fieldValue }
onChangeComplete={ ( value ) => changeHandler( value.hex ) }
disableAlpha
/>
</BaseControl>
);
}
case 'html': {
Expand Down

0 comments on commit 8ac165d

Please sign in to comment.