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
When clicking a hash link on a page, swup scrolls to the matching target element. But the :target selector doesn't have any effect. This example will paint the element #my-element red without swup enabled, but won't do anything with swup.
<ahref="#element">Scroll to element</a><divid="element">Element</div><style>
:target {
background: red;
}
</style>
Seems like fitting aria-current values could be location or simply true. I worry that using that attribute could interfere with consumer-scripts, though (they may be using the aria-current attribute already to mark an active tab or the like).
Maybe a simple swup-scroll-target or swup-current-target or swup-hash-target attribute would be less intrusive? In that case, it should be part of the Scroll Plugin, as you first suggested.
Describe the problem
When clicking a hash link on a page, swup scrolls to the matching target element. But the
:target
selector doesn't have any effect. This example will paint the element#my-element
red without swup enabled, but won't do anything with swup.Describe the proposed solution
From the discussion of the original issue on the core repo:
Research
A few links with prior discussions or solutions:
How important is this feature to you?
The text was updated successfully, but these errors were encountered: