#ColorInput optimization in controlled mode?
10 messages · Page 1 of 1 (latest)
use onChangeEnd instead of onChange
i don't have any event handlers defined. it's in uncontrolled mode
just dragging the mouse over the picker results in rerendering
does this mean this is correct? i don't pass key and getInputProps to ColorInput?
onChangeEnd={(v) => {
form.setFieldValue(`statuses.${index}.color`, v);
}}
format="hexa"
popoverProps={{ position: "bottom" }}
defaultValue={element.color}
fixOnBlur
// key={form.key(`statuses.${index}.color`)}
// {...form.getInputProps(`statuses.${index}.color`)}
/>```
Do not use form.getInputProps
okay. thank u
but settings the form field onChangeEnd is "alright"?
what does "key={form.key(statuses.${index}.color)}" do in this case by itself exactly?
form.key is required for uncontrolled form mode to work