mirror of
https://github.com/urbit/shrub.git
synced 2024-11-27 18:34:48 +03:00
ColorInput: fix initial field state
This commit is contained in:
parent
768549ce86
commit
52ce332f09
@ -37,8 +37,7 @@ function padHex(hex: string) {
|
||||
export function ColorInput(props: ColorInputProps) {
|
||||
const { id, placeholder, label, caption, disabled, ...rest } = props;
|
||||
const [{ value, onBlur }, meta, { setValue, setTouched }] = useField(id);
|
||||
const [field, setField] = useState('');
|
||||
// const [error, setError] = useState<string | undefined>();
|
||||
const [field, setField] = useState(uxToHex(value));
|
||||
|
||||
useEffect(() => {
|
||||
const newValue = hexToUx(padHex(field));
|
||||
|
Loading…
Reference in New Issue
Block a user