Class toggle on div when clicking an anchor with hash fragment #352
Replies: 2 comments 1 reply
-
Unpoly detects the Visible if you set up a mutation breakpoint for attribute changes on that element. Is the empty |
Beta Was this translation helpful? Give feedback.
-
Following up on this. After digging into the source code, I found that the Following is the source of function revealHash(hash = location.hash, options) {
let match = firstHashTarget(hash, options);
if (match) {
return up.reveal(match, { top: true });
}
} The Finally adding |
Beta Was this translation helpful? Give feedback.
-
So, I have webpage that has anchor tags using hash fragment to link to div's within the same page. The anchor tags are not processed by unpoly, meaning they are not using
up-follow
or any other directive that triggers unpoly navigation on click.However, everytime I click those links, the div on the same with the associated id gets an empty class attribute. For example, If I click
#home
, the div withid=home
will get a class attribute.Following is the recording of the behavior.
unpoly-anchors-demo.mov
Beta Was this translation helpful? Give feedback.
All reactions