-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix automatic scrolling with htmx requests #990
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good, but I think we should refactor the code to put most of this into the HAWCUtils.js file so we can reuse in other HTMX places. The same will be true on the epiv2 and eco forms, and TBH, they're used a lot more than the workflow edit forms, so we should move the goodness over there too.
@caseyhans is this one ready for re-review? |
# Conflicts: # hawc/apps/eco/templates/eco/design_update.html # hawc/apps/epiv2/templates/epiv2/design_update.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - I did mostly some minor code formatting changes:
@shapiromatron had to add back delete for workflow edit rows, or the create button scroll doesn't work after the first time |
Fixes the automatic scrolling on the workflows list page while CRUDing, and adds an animation for smoothness.
Previously, updating or creating a workflow would snap focus to the name input field of the first form present on the page (which creates a bug if multiple forms are present). After cancelling or saving the form, users would be left looking at the page footer, since the form is so long and the save/cancel buttons are at the bottom. This PR saves the scroll position before a form is brought onto the page and then reinstates that scroll position once form operations are complete.