Closed ivancheprasov closed 2 weeks ago
@ivancheprasov @KalachevDev
Current behavior: checkbox
checked
prop is always set due to the fallback ofdefaultValue ?? false
That's incorrect. defaultValue ?? false
is set for the hook's value and checked
input's attribute is only set when checked
prop is set. See source code here here
I digged the problem. There is no change event on inputs when form is reset. So our styling (custom tick svg) renders stale state. The only way to fix this I see is to not relay on our state but rather on browser's internal state (:checked, :indeterminate CSS selectors) to do our styling.
Please add an ability to use uncontrolled checkboxes, so that a checkbox can be used with libraries which require it to not have
checked
prop. For example, 'react-hook-form' with basic register solution.Current behavior: checkbox
checked
prop is always set due to the fallback ofdefaultValue ?? false
.