Hash/anchor in url prevents further url updates

On our discourse powered website we have a separate section which links to certain headings using an anchor/hash in the url, https://mysite.com/my-page#faq

When a user follows this link, the url is updated to that value, but navigating further no longer updates the url.

Is there a reason why the hash prevents any url updates? This currently breaks our app after some links in our app, eg ‘understand.html#understand’

This behavior can also be seen on any discourse powered forum, with a minimal reproducible example below.

  1. go to https://meta.discourse.org/
  2. append #foo to the url, so: Discourse Meta - The Official Support Forum for Discourse
  3. Click on any topic, you will see the url does not update

Thanks in advance!

1 Like

I think this one involves some Javascript debugging and would be best suited for @joffreyjaffeux.

The issue here is that our router uses hashes in some URLs (in particular, jumping to parts of posts, and I believe faq does it too.) I assume when it’s not a hash we know about somehow it’s breaking stuff, when we should be able to ignore it.

3 Likes

@eviltrout I think that should do it:

https://github.com/discourse/discourse/pull/7872

4 Likes

Merged!