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

Make sure scrollRestoration is writable. #127

Merged
merged 1 commit into from
Feb 5, 2018

Conversation

vizath
Copy link
Contributor

@vizath vizath commented Jan 16, 2018

Fixes #126

src/index.js Outdated
window.history.scrollRestoration = 'manual';
try {
window.history.scrollRestoration = 'manual';
} catch () {
Copy link
Owner

Choose a reason for hiding this comment

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

This isn't legal syntax.

src/index.js Outdated
try {
window.history.scrollRestoration = 'manual';
} catch () {
this._oldScrollRestoration = null;
Copy link
Owner

Choose a reason for hiding this comment

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

You may as well keep around this value, and add a try-catch around the attempt to reset it at the end.

@vizath vizath force-pushed the fix-scrollRestoration branch from 0d212a9 to 931513f Compare January 16, 2018 22:17
@taion
Copy link
Owner

taion commented Feb 5, 2018

Oops, I missed that you'd updated this.

@taion taion merged commit 4f6f2a5 into taion:master Feb 5, 2018
@vizath vizath deleted the fix-scrollRestoration branch February 5, 2018 17:00
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