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

Adding scroll to form if ID is requested in hash #183

Merged
merged 2 commits into from Dec 14, 2021
Merged

Adding scroll to form if ID is requested in hash #183

merged 2 commits into from Dec 14, 2021

Conversation

sarah-storm
Copy link
Contributor

Update to form render function so that if the window URL has a hash that matches the ID of the newly rendered form, then the window will scroll to it.

This is to resolve the bug where the form isn't always rendered quickly enough for the browser to recognise the jump-to default behaviour from the hash.

I'm not sure that my attempt to test this will actually do anything here in the JEST DOM?

@sarah-storm sarah-storm linked an issue Dec 14, 2021 that may be closed by this pull request
Copy link
Contributor

@mjbp mjbp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great idea. I have (as always!) a nitpick, also I'm not sure we can test this in JSDOM.

Copy link
Contributor

@mjbp mjbp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. I'll merge and publish to npm.

@mjbp mjbp merged commit 4d00f57 into master Dec 14, 2021
@mjbp mjbp deleted the bug/146 branch December 14, 2021 15:14
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.

Cookie banner - Chrome not scrolling to preferences form
2 participants