fix color input when value is invalid

This commit is contained in:
nklhrstv 2020-10-23 14:01:09 +03:00
parent c2f9ad410d
commit f44c2fe0af

View file

@ -11,7 +11,8 @@ const ColorPicker = require('./ColorPicker');
const styles = require('./styles');
const parseColor = (value) => {
return AColorPicker.parseColor(value, 'hexcss4');
const color = AColorPicker.parseColor(value, 'hexcss4');
return typeof color === 'string' ? color : '#ffffffff';
};
const ColorInput = ({ className, value, dataset, onChange, ...props }) => {