Closed manniL closed 10 months ago
It's apparently okay, from vendors' perspective, for this not to work with pushState()
. You can find some workarounds too at https://github.com/whatwg/html/issues/639. Using the regular <a>
tag for this seems fine too
Thanks for the quick insight 🙏🏻
Reproduction
https://stackblitz.com/edit/vue-router-2076
Steps to reproduce the bug
The
CartAside
component has CSS styles based on the:target
pseudoclass. It is triggered by the links on the page.Same with the close links after the overlay.
Expected behavior
When using the
RouterLink
with an id (e.g.#cart
), the:target
pseudoclass styles should be triggeredActual behavior
The
:target
styles are ignored.Additional information
As a workaround, using
<a>
tags works fine 👍🏻Related issue: https://github.com/nuxt/nuxt/issues/24415