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

anchor won't work when anchor/link's href is a complete link (/somepath#id) #8808

jjzhangg opened this issue Jan 3, 2018 · 2 comments


Copy link

@jjzhangg jjzhangg commented Jan 3, 2018





Reproduction link

Steps to reproduce

just scroll page

What is expected?

some link of the anchor being active

What is actually happening?

none link being active

We introduced base tag in our html
<head><base href="/somebase">...<head>
and with this setting, every #id, will be translated by browser into /somebase#id, not document.href#id. As a result, we need to specify anchor/link href as complete link.
But the current code of anchor, take href as #id by default, and will not work with a complete link like '/hello/world#id'.

Copy link

@ant-design-bot ant-design-bot commented Jan 3, 2018

It will be better to write your issue/comment in English, so more people can understand you.
And this means that more people can help you or benefit from your issue/comment.
See: #4897

@jjzhangg jjzhangg changed the title anchor无法支持href为完整url的情况 anchor won't work when anchor/link's href is a complete link (/somepath#id) Jan 3, 2018
Copy link

@dengfuping dengfuping commented Jan 3, 2018

@jjzhangg The problem exists indeed when opened in codesandbox. But it's all right in codepen and riddle.

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

Successfully merging a pull request may close this issue.

4 participants