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
sumitintelligaia commented
const [colorPicker, setColorPicker] = useState('#fff');
const handleColorPickerChange = (color) => {console.log(color)
setColorPicker(color);
}
<ColorPicker name="color" value={colorPicker} onChange={color => handleColorPickerChange(color)}
/>
PavlyukVadim commented
@sumitintelligaia just add such prop InputProps={{ value }}
sumitintelligaia commented
@PavlyukVadim Its giving me
And I am using functional component.
sergioguzman27 commented
@PavlyukVadim Its giving me 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 }}
/>
sumitintelligaia commented
okay Thanks!