Handling links with parameter and #
tsharms opened this issue · comments
I just noticed something. I'm adding Highway to an old project where we filter news articles. The filter uses parameters and we add an anchor to scroll to the right position on the page (the filters are half way down the page). The url structure we use is: /news/?type=events#posts
. But when i click on the anchor the page will hard reload instead of using the default transition. When the link is without the #posts
Highway will navigate to the page with the correct animation and filter. Is it something I'm doing wrong?
Hi @tsharms,
No, you are doing it right. When a URL contains an anchor on the same page, the page is hard reloaded to use the default behavior of the browser and to avoid reinventing the wheel. Does the filter work anyway?
Since we don't want to reinvent the wheel to scroll to anchors we'd prefer to keep it working as it does right now except if it breaks your filtering system. We don't want to increase the size of the library if we can rely on native browser features. Keep us in touch and don't hesitate to join our Slack to keep discussing this or other issues.
Best regards,
Anthodpnt
Hi @Anthodpnt thank you for your fast response.
The filtering system is working without any problems (It's just reloading). If this is a design choice I would keep it like that. I will use Slack next time :).
Thanks!
Best regards
Tom