You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m dealing with a form with input validation on blur. Some fields are mandatory and initially empty, so that if you blur by focusing another mandatory and empty field, you will get stuck in a perpetual focus/blur loop:
Screen.Recording.2024-10-11.at.01.54.58.mov
Apart from this, I feel like it’s more user-friendly to not programmatically change the focus on blur, since it is unexpected and counters the user action:
Screen.Recording.2024-10-11.at.01.58.03.mov
Suggested solutions:
Don’t focus-on-error when the validation happens onBlur
Add a boolean option to disable the focus-on-error behavior altogether
Are you open to a quick PR that adds a boolean focusOnError to the form options?
Thanks.
Conform version
v1.2.2
Steps to Reproduce the Bug or Issue
See screen recording above. Have two <input type="text" />s that are validated on blur, validation schema should be z.string() for both (which Conform interprets as disallowing ""), initial value should be "", blur one input by focusing the other input.
What browsers are you seeing the problem on?
Chrome, Firefox, Microsoft Edge, Safari, Others
Screenshots or Videos
See above
Additional context
Previously commented on this discussion, but I figured I could open an issue since this is probably unexpected behavior.
The text was updated successfully, but these errors were encountered:
Describe the bug and the expected behavior
I’m dealing with a form with input validation on blur. Some fields are mandatory and initially empty, so that if you blur by focusing another mandatory and empty field, you will get stuck in a perpetual focus/blur loop:
Screen.Recording.2024-10-11.at.01.54.58.mov
Apart from this, I feel like it’s more user-friendly to not programmatically change the focus on blur, since it is unexpected and counters the user action:
Screen.Recording.2024-10-11.at.01.58.03.mov
Suggested solutions:
Are you open to a quick PR that adds a boolean
focusOnError
to the form options?Thanks.
Conform version
v1.2.2
Steps to Reproduce the Bug or Issue
See screen recording above. Have two
<input type="text" />
s that are validated on blur, validation schema should bez.string()
for both (which Conform interprets as disallowing""
), initial value should be""
, blur one input by focusing the other input.What browsers are you seeing the problem on?
Chrome, Firefox, Microsoft Edge, Safari, Others
Screenshots or Videos
See above
Additional context
Previously commented on this discussion, but I figured I could open an issue since this is probably unexpected behavior.
The text was updated successfully, but these errors were encountered: