remix-validity-state
remix-validity-state copied to clipboard
fix: Check for `event.preventDefault()` before setting state
If a user prevents a form input's default behavior, the onChange in getInputAttrs shouldn't set state internally. To fix this I call the user's handler first, check for event.defaultPrevented and then continue with the internal event handler.