Can't get infinite scroll to work
CodeSandbox: https://codesandbox.io/s/natural-gallery-js-issue-czh8cg
My best guess is I'm using setItems() when maybe I should be using addItems()?
Anything look obviously wrong in that CodeSandbox?
Nothing obvious from my side and I can't run your demo.
As gallery has been updated since then, I think this issue as already been addressed.
technical word anyway : gallery resizes itself to fill the viewport and allow the infinite scroll. If for some reason it can't expand it's wrapper, and has a height of 0 after initialisation, it will work without infinite scroll, because content never expands bellow visible viewport.
Updated the sandbox, try now @sambaptista:
https://codesandbox.io/p/sandbox/natural-gallery-js-issue-czh8cg
Issue persists, kindly reopen 🙂
It seems to be due to the wrapping into id="main".
If I remove this "useless" wrapper, it works. Do you need it for some reason ?
On your exact demo, the overflow is managed by the body, but you provide id="main"element as the scrollable element (3rd argument). The gallery does not detect the scroll because there is no scroll on this element.
You can just remove the 3rd argument when instantiating gallery and it works.
Good continuation :)