This library has made the choice to validate inputs on blur; this is a totally reasonable choice for normal text inputs as it stops potential off-putting switching between validity states as the user types. For radios and checkboxes though there’s no typing to be done, yet the library still waits for a blur event (i.e. a click somewhere else or a tab away) before updating the visual validity state.
This commit adds a click event handler for radios and checkboxes that will evaluate the validity immediately after the browser changes the internal state of the control. This provides immediate feedback to the user that they’ve corrected the problem.
Example without this change (this is particularly bad as it’s using a custom form control that is basing its styling on validate’s state):
This library has made the choice to validate inputs on blur; this is a totally reasonable choice for normal text inputs as it stops potential off-putting switching between validity states as the user types. For radios and checkboxes though there’s no typing to be done, yet the library still waits for a blur event (i.e. a click somewhere else or a tab away) before updating the visual validity state.
This commit adds a click event handler for radios and checkboxes that will evaluate the validity immediately after the browser changes the internal state of the control. This provides immediate feedback to the user that they’ve corrected the problem.
Example without this change (this is particularly bad as it’s using a custom form control that is basing its styling on
validate
’s state):Example with this change: