Bug? Linking to an anchor behaves differently when linking from another page?

fbunting October 15, 2018

Linking to an anchor (created using the Anchor macro) on the same page works just fine.

However, when you link to that anchor from another page, it links to a location a few lines below where the anchor is located.  

I.e. it correctly goes to the page, and to the correct location, and then immediately scrolls down a few lines.   If the anchors is placed just above a header, it scrolls to the first paragraph below the header.   If the anchor is placed just above a paragraph, it scrolls to the third line of the paragraph.

Has anyone else noticed this?  Is there any solution (other than placing the anchor a few lines _above_ where you want it to link to)?

3 answers

0 votes
David Fenstermacher November 15, 2019

I have a similar issue. The anchor is at the top of the page. When one clicks on a link pointed to it further down in the document, The page scrolls up to about 4 lines below the Anchor position. One has to manually scroll the rest of the way up.

The only work around I have found is to add 3 blank lines between the top anchor and the table of contents macro. So, the full table of contents will totally show up when the below link is clicked.

Any thoughts on what would cause the link to not scroll completely up to the anchor location?

0 votes
Michelle Rau good
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 7, 2019

I have noticed this behavior too and I don't know why it happens. It can confuse users because they might not land where they expect.

I have seen if a web page is short, then the browser will stop at the end of the page, regardless of where the anchor is. This can result in the linked-to anchor appearing in the middle of the page instead of at the top as expected.

fbunting September 13, 2020

Actually, this is the correct (expected) behavior.  A browser can't scroll any further than the end of the page.  So if the target anchor is less than a screenful from the bottom of the page, then it will end up in the middle of the display window.  

0 votes
Stephan Gehring August 7, 2019

We see similar behavior when linking from a draw.io figure to a place on the same place as the draw.io figure.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events