Custom Header Links: links reload Discourse

I’m using the Custom Header Links component and I’m getting this strange behavior:

  • In my prod instance, clicking a header link reloads Discourse entirely to the target page.
  • In my dev instance (without docker), clicking a header link transitions smoothly to the target page without reloading Discourse.

I noticed that:

  • In my prod instance, <a> tags have a data-auto-route="true" attribute.
  • In my dev instance, <a> tags don’t have this attribute.

It seems the same kind of problem happened in the past (see here), before the official header components were released.

2 Likes

I created a fork to fix this issue: https://github.com/sylque/discourse-custom-header-links.

Reverting the change from @joffreyjaffeux breaks internal links in a different way. I wouldn’t use a forked plugin - it just means when this gets fixed for real you won’t receive the changes automatically.

The commit in question:

https://github.com/discourse/discourse-custom-header-links/commit/bfda9d3b50bd8e027024b62aa0b7e68611248073

1 Like

Any ideas @joffreyjaffeux?

2 Likes

This is fixed in the official component, internal links will no longer cause a full page reload.

Thanks for reporting the issue @jack2 :+1:

5 Likes