smoothscroll-anchor-polyfill icon indicating copy to clipboard operation
smoothscroll-anchor-polyfill copied to clipboard

:target pseudo-class is not toggled

Open jonaskuske opened this issue 6 years ago • 0 comments

When the polyfill updates the URL through pushState(), CSS pseudo-classes like :target are not updated accordingly. This is actually a browser bug as the spec is very clear about this, but we can maybe still work around it by setting location.hash after the scroll is completed (so it doesn't interrupt the smoothscroll), similar to pendingFocusChange – shouldn't be visible at all, as the hash was updated by history.pushState before already, but hopefully it force-updates :target CSS classes etc.

jonaskuske avatar Feb 01 '19 02:02 jonaskuske