You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The catch-navigation currently looks if a link is clicked with href="#anchor" but it will never catch a link to the current page using href="/url/to/current/page#anchor" because only the attribute value is considered and only if it contains nothing else.
The detection for a link pointing to the current page is actually fairly simple:
Hey there. Thanks a lot for your bug report and repro. This has been fixed in the latest release (v2.0.12). I took great inspiration from your detection, thanks a lot.
https://github.com/wessberg/scroll-behavior-polyfill/blob/45593dcfc35f98b64230579eb01ac821c5d9f67d/src/patch/anchor/catch-navigation.ts
The catch-navigation currently looks if a link is clicked with
href="#anchor"
but it will never catch a link to the current page usinghref="/url/to/current/page#anchor"
because only the attribute value is considered and only if it contains nothing else.The detection for a link pointing to the current page is actually fairly simple:
Here is a reproduction: https://jsfiddle.net/ey087v3o/ (tested in safari and chrome)
The text was updated successfully, but these errors were encountered: