Skip to content
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

Add anchors and redirect embeds to help preserve scroll position #436

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

crowesn
Copy link
Contributor

@crowesn crowesn commented Mar 4, 2024

Resolves #420

Workaround to help preserve scroll position while editing objects in combined show view/form.

  • Add anchors to section headers
  • Embed anchors in controller redirects for all appropriate actions
  • In the controller specs, add checks for anchors in the redirects

@crowesn crowesn force-pushed the 420/preserve-scroll-position branch from ef7afc1 to ee50a73 Compare March 4, 2024 22:14
@Janell-Huyck Janell-Huyck self-assigned this Mar 7, 2024
@Janell-Huyck
Copy link
Contributor

The code is fine and works as expected. Unfortunately, when a user does not fill out all the fields for an in-house repair or external repair, the flash message indicating that the repair was not created is no longer visible. The user would need to scroll to the top of the record to view it. From the user's point of view, no notification occurs that a repair failed to save.

This maybe should be solved in a separate issue. Perhaps the pop-up for creating the repair could refuse to close if all the required fields aren't filled out?

@Janell-Huyck
Copy link
Contributor

It could be as simple as marking the items that are required as required: true to force their selection from within the modal.

@crowesn
Copy link
Contributor Author

crowesn commented Mar 7, 2024

I think we could set a conditional to reroute to top in case of validation failure. I'm intrigued about a js solution to the scrolling issue.

@crowesn crowesn force-pushed the 420/preserve-scroll-position branch from ee50a73 to edb1fba Compare March 8, 2024 18:08
@crowesn
Copy link
Contributor Author

crowesn commented Mar 8, 2024

@Janell-Huyck Flagged the required fields. This should be ready to go.

@crowesn crowesn force-pushed the 420/preserve-scroll-position branch 2 times, most recently from ab9698d to a96285c Compare March 11, 2024 14:59
@crowesn crowesn force-pushed the 420/preserve-scroll-position branch from a96285c to a01d131 Compare March 11, 2024 15:18
@Janell-Huyck Janell-Huyck merged commit d1b28f0 into qa Mar 11, 2024
2 checks passed
@Janell-Huyck Janell-Huyck deleted the 420/preserve-scroll-position branch March 11, 2024 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Preserve position after save
2 participants