-
Notifications
You must be signed in to change notification settings - Fork 595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
handling both hash routing & anchor links #440
Comments
Forgot to add: Current behavior of The goal (I think) is to avoid this behavior when the |
Instead of checking if the id exists, perhaps we could prefix the hash if we want to use it as an anchor. Something like this: |
Heya, thanks for the suggestion! - Personally I wouldn't want a framework
to tell me how to write my links, but just work as expected. Think we
should explore making that work first (think it might already? not sure,
not tested) and only if that's truly impossible look for different options.
Hope that makes sense ✨
…On Sat, Apr 8, 2017 at 1:36 AM Jens Lind ***@***.***> wrote:
Instead of checking if the id exists, perhaps we could prefix the hash if
we want to use it as an anchor. Something like this: /route#anchor:id,
just a thought.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#440 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACWlej12aoysc71HoelYNBLGEnrJqeHvks5rtshqgaJpZM4MnbQp>
.
|
Totally agree! Another thought off the top of my head.. 💭 🐈 |
Do you have a hash routing example? I cannot get it to work. |
As a fairly new user of choo (and so far overall super impressed by it 🎉) I’m having a bit of trouble understanding the way anchor links are handled. How come you have decided to turn It took awhile for me to wrap my head around what the section Hash routing in the README.md really meant (and how to get anchor links working like they usually do) – but that might just be me as a confused newbie. 🤔 ✨ |
It seems like the always-there default to top ( |
how do you prevent that? |
Any success on this? |
As I'm porting minidocs to choo v5 I'm working on making choo v5 support both hash routing & navigating to anchor links if they are present on the page.
The tricky part is that when the router is first called, the element isn't available on the page yet: https://github.com/yoshuawuyts/choo/blob/master/index.js#L50
So there's not a way to check if an id is available to scroll to before the router is called.
Thoughts on how to implement this?
The text was updated successfully, but these errors were encountered: