When My user goes through a form, fills in all the fields and is scrolled to the bottom, they click a button to submit the data. A function is called that checks for errors. If there are validation errors the same page is loaded via page loader and a dialog is displayed asking user to fix errors which are displayed in red for each errored field entry using states. Is there any way I can get the browser to scroll up to the first errored field after, or before the dialog is displayed so they start off at the first error ed field instead of manually needing to scroll up and hunt for the errors? Couldn’t find guidance in docs. Thx. for ideas.
Hello Robert,
Automatically scrolling to the first errored field after a page reload is not currently possible, as the scroll position is reset. A practical approach in this case is to highlight the field where the error occurs to help guide the user.
Hi Robert, indeed there is no way to control scrolling or which field has the focus.
We can imagine various improvements to cover this:
- Some new standard actions for scrolling or focus
- Perhaps @ayoub could think of a new custom component button that could perform a scroll’up: Share Your Custom Component Ideas with Us! 🚀
- We also have a backlog entry for surface control / conditional formatting that could eventually cover such thing
Feel free to suggest what would better suit your needs!
Thanks All. I think @mathieu.ferry has great suggestion for a standard action. Scroll to/focus. Thanks!