This should fix visibility variants not being triggered when the element should already be visible on page load. It's a bit of a head scratcher, but I think this issue may be exclusive to directive usage (not when using <Motion />).
I'm assuming that useIntersectionObserver doesn't play nice when called in created simply based on v-intersection-observer directive using the mounted hook in @vueuse/components (see source here).
Unfortunately I wasn't able to add a test for this, maybe intersection observer doesn't work in happy-dom? If anyone knows how to properly test this behaviour and could give me pointers on how to do so I would feel a lot better about this fix ๐ ..
Issues
This should fix visibility variants not being triggered when the element should already be visible on page load. It's a bit of a head scratcher, but I think this issue may be exclusive to directive usage (not when using
<Motion />
).I'm assuming that
useIntersectionObserver
doesn't play nice when called increated
simply based onv-intersection-observer
directive using themounted
hook in@vueuse/components
(see source here).Unfortunately I wasn't able to add a test for this, maybe intersection observer doesn't work in
happy-dom
? If anyone knows how to properly test this behaviour and could give me pointers on how to do so I would feel a lot better about this fix ๐ ..