anchor won't work when anchor/link's href is a complete link (/somepath#id) #8808
Labels
Comments
It will be better to write your issue/comment in English, so more people can understand you. |
@jjzhangg The problem exists indeed when opened in codesandbox. But it's all right in codepen and riddle. |
This was referenced Jan 4, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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'.
The text was updated successfully, but these errors were encountered: