Skip to content
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

Menu links don't work on anchors that begin with a slash #2803

Closed
justinjereza opened this issue Jul 19, 2017 · 5 comments
Closed

Menu links don't work on anchors that begin with a slash #2803

justinjereza opened this issue Jul 19, 2017 · 5 comments

Comments

@justinjereza
Copy link

Description

Anchors don't work if the id starts with a slash such that a target URL link becomes "http://example.net/#/foo" as an example. On the other hand, "http://example.net/#foo" works as expected.

Link to isolated reproduction with no external CSS / JS

The problem is reproduced at https://jsfiddle.net/zug82bb1/4/

Steps to reproduce it

Only the "Baz" menu link scrolls to the Baz section. The other menu links with anchors that begin with a slash don't work.

Versions

Windows 10 64-bit, Google Chrome Version 59.0.3071.115 (Official Build) (64-bit)

@alvarotrigo
Copy link
Owner

Why would anyone want to use those anchors? Honest question :)

@justinjereza
Copy link
Author

Haha. Fair point.

Honestly, it's just because I think they look better that way in the address bar. It's easier to see where the beginning of a path specified in the hash fragment is (http://example.net/#foo/bar vs http://example.net/#/foo/bar). Angular does the same thing with https://angular2.realworld.io/#/article/how-to-train-your-dragon-30ps16 as an example.

@alvarotrigo
Copy link
Owner

Feel free to provide a pull request for it. I'll mark it as an enhancement.

@justinjereza
Copy link
Author

Ok, thanks.

@alvarotrigo
Copy link
Owner

alvarotrigo commented Oct 12, 2017

Now possible in the dev branch, to be merged in 2.9.5.
Updated fiddle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants