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

Closed
jjzhangg opened this Issue Jan 3, 2018 · 2 comments

Comments

Projects
None yet
4 participants
@jjzhangg
Contributor

jjzhangg commented Jan 3, 2018

Version

3.1.0

Environment

any

Reproduction link

https://codesandbox.io/s/o97wp51vmq

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'.

@ant-design-bot

This comment has been minimized.

Show comment
Hide comment
@ant-design-bot

ant-design-bot 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

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 from anchor无法支持href为完整url的情况 to anchor won't work when anchor/link's href is a complete link (/somepath#id) Jan 3, 2018

@dengfuping

This comment has been minimized.

Show comment
Hide comment
@dengfuping

dengfuping Jan 3, 2018

Contributor

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

Contributor

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