svelte-intersection-observer icon indicating copy to clipboard operation
svelte-intersection-observer copied to clipboard

time to time observer not attached to DOM element

Open nosovk opened this issue 5 years ago • 4 comments

Currently intersection observer not always initialized after hydration.

For example - https://github.com/MailCheck-co/mailcheck.site/blob/master/src/components/Partners.svelte

It's live on https://www.mailcheck.co/ - if you will start scrolling during load it will never trigger.

That PR https://github.com/metonym/svelte-intersection-observer/pull/13 supposed to fix such a behavioure, but seems like problem does not fixed by moving subscription to onMount handler.

nosovk avatar Apr 12 '21 23:04 nosovk

Any update on this, @nosovk @metonym ? Or if there are steps to resolve this, what steps should I take to contribute?

timsully avatar Jun 17 '21 02:06 timsully

We now adopting https://github.com/maciekgrzybek/svelte-inview will see result at https://mailcheck.co after merge of https://github.com/MailCheck-co/mailcheck.site/pull/281

nosovk avatar Jun 17 '21 10:06 nosovk

We now adopting https://github.com/maciekgrzybek/svelte-inview

This should be in the readme :)

I spent quite some time scratching my head about weird behavior with this one. Fixed by using bare IntersectionObserver. BTW, inview installs 19 packages, it's a no-no for me.

j2l avatar Nov 23 '21 10:11 j2l

Actually there are no dependencies in it, all listed it devDeps, that needed to make bundle (rollup, typescript ts). There was missed peerDeps in it, but there is a PR to fix that.

nosovk avatar Nov 23 '21 13:11 nosovk