Skip to content

handling both hash routing & anchor links #440

@sethvincent

Description

@sethvincent

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions