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

Fix TOS page jump to bottom. #1292

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Fix TOS page jump to bottom. #1292

wants to merge 2 commits into from

Conversation

P-Gill97
Copy link

@P-Gill97 P-Gill97 commented Jan 29, 2025

@P-Gill97 P-Gill97 self-assigned this Jan 29, 2025
@P-Gill97
Copy link
Author

P-Gill97 commented Jan 29, 2025

The issue is due to the browser autofocusing to the checkbox which causes the browser to scroll when the policy is longer than a page. I tried updating the checkbox line here <%= f.check_box :i_agree, style: "height: 1.3rem"%> by adding the attribute for autofocus: false. It did not work and the page kept jumping down to the bottom. So instead I added an DOMContentLoaded event listener document.addEventListener("DOMContentLoaded", function() { and set the window scroll to the top of the page using window.scrollTo(0, 0);. This is my first time working on accounts and working with Ruby so let me know if there is something obvious I am missing.

@P-Gill97 P-Gill97 marked this pull request as ready for review January 29, 2025 22:55
@P-Gill97 P-Gill97 requested a review from Dantemss January 30, 2025 19:08
@Dantemss
Copy link
Member

I am worried that this will cause the page to flash different positions when loading?
Also wondering if the second thing mentioned in the card (the button not being visually disabled) has been fixed already or if it's still an issue.

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.

2 participants