fix: visibility variants not triggered when visible on load #171
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 😅..