-
-
Notifications
You must be signed in to change notification settings - Fork 432
Anchor tags cannot be accessed from other pages #341
Comments
@Rich-Harris, correct if I'm wrong on this issue. I believe that Sapper uses roadtrip (or part of it) for routing. Roadtrip is made with some inspiration from page.js and both of them suffer from this issue. I am with the same problem If I find a solution, I will happily do a PR to both page.js and sapper, as I've done before (on page.js and sapper). |
@Rich-Harris if I submit a PR to roadtrip, is it easy for you to re-adapt it to sapper? |
@paulocoghi I think I might have just yanked the code from roadtrip/page that filtered out anchor tags that the router shouldn't be concerned with — they're not in sync or anything. But if there's a fix that works for one then hopefully it'll work for all... |
@Rich-Harris, here are my current findings:
My temporary solution is to call
¹ 93+% browser support when not using the |
I need more time to infer if it is possible to improve our routers' logic in a way where we don't need to call anything and succeed in all possible navigation cases. Until then, I believe that using |
Fixed by @DayBr3ak in 0.23.1! |
Hurray! Thanks @DayBr3ak ! |
Navigation to an anchor link from another page doesn't work, and only takes you to the top of the page. However, navigation to an anchor link does work if you are already on the page.
I encountered this issue when trying to create drop-down top navigation items that take you to an anchor within another page.
You can reproduce the error here: https://github.com/alizauf/another-anchor-test
This may be related to #331 (and thanks @mhkeller) for a convenient sample repo to easily demonstrate.
The text was updated successfully, but these errors were encountered: