-
Notifications
You must be signed in to change notification settings - Fork 124
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
Scroll to anchor behavior is different when a anchor link is opened in a different tab #1150
Comments
@le0tan can take a look? |
@damithc I can't reproduce this bug. Is this bug still there after restarting the browser? |
@le0tan Noticed this in two computers. Yes, can reproduce. May be specific to OS and Browser? |
@damithc I'm on Windows as well, which version of Chrome are you using? |
I now can reproduce this using Firefox. I can confirm that the anchors are correctly generated and |
Could it be due to expanded panels? There are quite a few expanded panels in the 2113 website. I faced the same problem on the 2113 website on Ubuntu 18.04 Firefox. But I tried on https://markbind.org/userGuide/fullSyntaxReference.html#lists and it always scrolled to the correct heading. |
Not likely as I tried on the MarkBind doc, and there's no expanded panels in the documentation. |
Just encountered this. My finding is that if the anchor link is
The error occurs when you
Reproduction step:
Not sure but it might be related to #1948 |
could it simply be due to the ordering? (should be swapped) (still, odd that it works using a "normal" click to open) scrollToUrlAnchorHeading();
detectAndApplyHeaderStyles(); I think we could try adapting this part to use the detected sticky header height as well, if any window.scrollBy(0, -document.body.style.paddingTop.replace('px', '')); |
I did some research on this. The issue with this is that scrollIntoView does not work when the document is not visible on our end. Some solutions that I have attempted but to no avail.
Somehow, even if we perform scrolling on visible and after onLoad, the scroll margin top value is still incorrect initially. I only have hacky ideas to fix it.
|
In addition,
|
v2.12.0, Chrome, Windows
Ctrl+Click (to open in new tab) on this link
Expected (this is what you get if you normal-click on the link):
Actual:
The text was updated successfully, but these errors were encountered: