LoicMahieu/material-ui-color-picker

When I am changing the color from palette hex code is not getting updated the input field I am using functional component

sumitintelligaia opened this issue · 4 comments

const [colorPicker, setColorPicker] = useState('#fff');
const handleColorPickerChange = (color) => {console.log(color)
setColorPicker(color);
}
<ColorPicker name="color" value={colorPicker} onChange={color => handleColorPickerChange(color)}
/>

@sumitintelligaia just add such prop InputProps={{ value }}

@PavlyukVadim Its giving me
image
And I am using functional component.

@PavlyukVadim Its giving me image And I am using functional component.

You used a color prop but you should use value prop. For example:

<ColorPicker
       InputProps={{ zIndex: 0, value: valueColor }}
/>

okay Thanks!