Fix anchors not working (#20255)
This commit is contained in:
parent
3b37658df5
commit
2314043432
1 changed files with 9 additions and 7 deletions
|
|
@ -170,6 +170,15 @@ if (document.location.pathname === '/admin/creator_settings/new') {
|
|||
}
|
||||
|
||||
document.ready.then(() => {
|
||||
// Our infinite scroll pattern causes problems with the browser's back button:
|
||||
// specifically, if you've scrolled into page 2+, click into a post, then back
|
||||
// to the feed, the browser scroll position will not be where you had previously
|
||||
// scrolled. This seems to fix it, even though it seems like it should have
|
||||
// the opposite effect.
|
||||
setTimeout(() => {
|
||||
history.scrollRestoration = 'manual';
|
||||
}, 0);
|
||||
|
||||
const hamburgerTrigger = document.getElementsByClassName(
|
||||
'js-hamburger-trigger',
|
||||
)[0];
|
||||
|
|
@ -179,10 +188,3 @@ document.ready.then(() => {
|
|||
trackCreateAccountClicks('authentication-hamburger-actions');
|
||||
trackCreateAccountClicks('authentication-top-nav-actions');
|
||||
trackCreateAccountClicks('comments-locked-cta');
|
||||
|
||||
// Our infinite scroll pattern causes problems with the browser's back button:
|
||||
// specifically, if you've scrolled into page 2+, click into a post, then back
|
||||
// to the feed, the browser scroll position will not be where you had previously
|
||||
// scrolled. This seems to fix it, even though it seems like it should have
|
||||
// the opposite effect.
|
||||
history.scrollRestoration = 'manual';
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue