ustaxcourt / ef-cms

An Electronic Filing / Case Management System.
https://dawson.ustaxcourt.gov/
Other
88 stars 47 forks source link

10074 bug: Auto Scroll Issues on Petitions Clerk Create Case Form #5371

Closed Mwindo closed 1 month ago

Mwindo commented 2 months ago

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:

  1. 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.
  2. 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.
Mwindo commented 1 month ago

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.