Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change validateOnBlur default to true for better accessibility by default #250

Open
danielnixon opened this issue Jul 22, 2019 · 0 comments

Comments

@danielnixon
Copy link
Contributor

danielnixon commented Jul 22, 2019

Please consider changing the default value of validateOnBlur from false to true.

See e.g. https://developer.paciellogroup.com/blog/2019/02/required-attribute-requirements/ for motivation.

When its time to mark a form control as invalid, the attribute’s value should be set to “true”. Ideally, a control should be set to invalid only after a required control has been focused, and then blurred, without a proper string being entered.

If writing a script to check for input validity while a control is still focused, flagging a control as invalid should only happen after a few seconds have passed without a keypress event being fired. People may find it frustrating, and potentially even confusing, if they receive feedback that their entry is invalid while they’re typing.

They sum up:

Be patient before marking a form control as invalid and displaying an inline error message. Ideally wait until the control has lost focus, or there has been an adequate delay in key presses.

As an alternative, please consider documenting this consideration with the default behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant