When a form is long enough to require scrolling, a user filling it out is likely scrolled partway down before submitting. If the submission fails, onError() prepends one or more error messages to the top of the form, but the viewport is still positioned where the user was. The errors are rendered above the view port and the user has no visual indication that anything happened.
Steps to reproduce
- Open a page with a long
CompatForm (should be scrollable).
- Scroll down and submit the form in a way that adds a form message.
- Observe: the errors at the top of the form are not visible without scrolling to top manually.
Expected behavior
I'm not quite sure what the expected behavior should be. One option could be to scroll to top automatically if an error occurs. After a failed submission the browser should scroll the first error callout into view, so the user immediately sees what went wrong. But there could be better ways to solve this.
When a form is long enough to require scrolling, a user filling it out is likely scrolled partway down before submitting. If the submission fails,
onError()prepends one or more error messages to the top of the form, but the viewport is still positioned where the user was. The errors are rendered above the view port and the user has no visual indication that anything happened.Steps to reproduce
CompatForm(should be scrollable).Expected behavior
I'm not quite sure what the expected behavior should be. One option could be to scroll to top automatically if an error occurs. After a failed submission the browser should scroll the first error callout into view, so the user immediately sees what went wrong. But there could be better ways to solve this.