Replies: 1 comment 8 replies
-
I did not understand the issue or, most likely it is related only to NumberInput (because it supports undefined as value). Components are considered controlled when |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi
There is a custom component QuantityInput
It uses recommendations from the docs, how to configure it to add support for controlled & uncontrolled version of usage.
I have one problem.
In all Mantine components,
value
&onChange
props is a signal that component is controlled.If one of this props is omitted (for example value is used without onChange) - value will be unchanged (see simple input in example).
However, in example below, if we used both value and onChange, but onChange not update value, internally logic to set value is mixed, and in UI we see that value changes.
How to prevent this unexpected behavior?
https://codesandbox.io/s/silent-bush-5l6l6g?file=/src/quantity-input/quantity-input.component.tsx
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions