Navigating to an anchor link does not go to that anchor (Bug) (Confluence Cloud)
Asked by Daniel G. Pritchard:

Hello,

I have a bug that's pretty easy to reproduce for me.

#### Steps to reproduce: {#toc-hId--570227101}

1. Go to a confluence page with headings and where it's long enough that there are several screens worth of content

2. Hover over a heading (not the first one)

3. Click on the anchor to copy an anchor link

4. Close the tab and make a new tab and try to go to the link you just copied

#### Expected: {#toc-hId-1917285732}

* It goes to that general area of the page
* Also, if anyone goes in to make decent requirements and write some tests for this feature, the heading in question should not be obscured by the "sticky header" (which no one needs but every site has now)
* Perhaps it should even subtly highlight the heading you are supposed to see

#### Reality: {#toc-hId-109831269}

* You just always end up at the top of the page as though the # section wasn't even in the URL

It does to sort of try to go there for a second but after the client-side stuff finishes initing and flashing and moving things around, you're left at the very top of the article.


Answers:
author: Kathy Hart
body: I am experiencing this same thing.

I'm using Heading Text inside a table. I copy the Anchor from the Heading Text and use it on another page, so, in theory, you jump from the other page directly to the part of the table pertaining to that link.

You land on the page, but BELOW the Anchored Heading, so the 'sticky' table header line is obscuring the Heading which you jumped to. This makes it look like the link didn't work. You have to know to scroll up to find the linked item.

I have also found that if you use an anchor created with a macro, you have to put it on the line ABOVE the text you want to anchor to, otherwise the same thing happens. You arrive on the page BELOW the anchor, and you have to scroll up to see what you want.

This is not good when the public will be viewing your page. It makes it look like your links don't work correctly.

The work-around being, that you have to put in macro anchors a line or two ABOVE where you want to land on the page.


author: Shannon S
body: Hello Daniel,

Welcome to Atlassian Community. It's nice to meet you.

I've encountered this issue myself. Have you tested in both Firefox and Chrome, and do you face the problem in both?

There are two issues that I am aware of right now; one is the problem you've encountered, and the other is within pages. I've seen in past instances of this bug that Firefox isn't *always* affected.

I'll share those bug reports below. If you're affected by these, click **This affects my team**, and if you don't have the option, check to make sure you don't have to login again.

* [CONFCLOUD-62589](https://jira.atlassian.com/browse/CONFCLOUD-62589) *Following a link to an anchor within another page doesn't scroll at all after getting to the other page*
* [CONFCLOUD-67771](https://jira.atlassian.com/browse/CONFCLOUD-67771) *Anchor links from a page placed in another one don't redirect to the anchor link*

We are also re-releasing the Anchor macro soon. It will allow users to create their anchor links anywhere on a page in the new editor. Keep an eye out for updates related to that. I don't believe it should fix your problem, but let me know if you notice any changes in the meantime.

* [CONFCLOUD-69198](https://jira.atlassian.com/browse/CONFCLOUD-69198) *Allow Anchors to be specified anywhere in a page*

Thank you, and take care!

Shannon

comments: author: Daniel G. Pritchard
body: I use the current release of Edge, which is like Chrome. Haven't tested in Firefox.


author: Kevin Ketchum
body: While not an answer, I have some observations on this.  
I have found that then running the latest version of Chrome (88.0.4324.190), the #anchor in a Confluence URL does not work.

However, using an earlier version of Chrome (88.0.4324.150), and using the exact same link, the anchor does work.

I am using Confluence Data Center, but I think this more an issue relating to the Chrome version.

When using the same link in Firefox (version 82.0.3), the anchor works.

comments: author: Shannon S
body: Hi Kevin,

Thank you for sharing your findings. The bug in particular that is affecting Daniel is specific to Confluence Cloud. If you're finding similar behavior with Confluence Data Center, you'll want to raise a new question regarding that or get it to Atlassian Support so we can raise it with the appropriate team.

Thank you again and take care!

Shannon


author: Kevin Ketchum
body: My point was simply to alert users that this may not only a confluence thing - it may be a chrome thing.

And I will be adding new question for DC.


Tags: anchor

cloud

confluence-cloud