-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Provide a general summary of the issue here
React ARIA's "native" validation doesn't work like HTML5 native validation works in most browsers, which results in a significantly worse user experience.
🤔 Expected Behavior?
In most modern browsers, when an HTML5 validation error is already showing, the validation error will update in real time until the user has fixed it, and then the error will immediately go away without the user blurring the field.
😯 Current Behavior
When validationBehavior
is set to "native"
and a validation error is showing, the error will never go away until the user blurs the field. The error message also won't update if the native validation issue changes until the user blurs the field.
💁 Possible Solution
I think the useFormValidation
component should have two modes:
- A "lazy" mode which is initially active - in this mode it would only call
state.commitValidation()
in thechange
event handler - An "eager" mode which becomes active while a native validation error is showing - in this mode if would call
state.commitValidation()
in aninput
event handler
🔦 Context
No response
🖥️ Steps to Reproduce
https://codesandbox.io/s/quirky-meitner-jl79fh?file=/src/App.js
Version
latest
What browsers are you seeing the problem on?
Firefox, Chrome, Safari
If other, please specify.
No response
What operating system are you using?
macOS Sonoma 14.3
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response