On the form for petitions clerk creating a case, we validated on blur, on change, etc., and this validation would automatically (and disruptively) scroll to the top to show the validation errors message box. This PR adds a preventAutoScroll flag (or rather revises an existing flag that was not fully implemented) in order to prevent this scrolling behavior.
A couple of notes:
It would be very easy to get carried away refactoring. I tried to find a middle ground: I updated onBlur and onChange to take in functions rather than strings as needed, updated a few components that caused typing issues as needed, but otherwise kept things the same.
I decided that preventAutoScroll: false would be the default even if it turns out that we need preventAutoScroll: true in most instances. (The only time it makes sense to scroll, I think, is on submission.) This was to keep behavior the same so that developers are not surprised about new behavior.
This is just clutter currently. I will reopen as needed, although I might just re-create the branch given the number of changes I made to the test branch.
On the form for petitions clerk creating a case, we validated on blur, on change, etc., and this validation would automatically (and disruptively) scroll to the top to show the validation errors message box. This PR adds a
preventAutoScroll
flag (or rather revises an existing flag that was not fully implemented) in order to prevent this scrolling behavior.A couple of notes:
preventAutoScroll: false
would be the default even if it turns out that we needpreventAutoScroll: true
in most instances. (The only time it makes sense to scroll, I think, is on submission.) This was to keep behavior the same so that developers are not surprised about new behavior.