Open CezCz opened 2 years ago
Looks like a similar issue to https://github.com/adobe/react-spectrum/issues/2365 (in ComboBox) (fixed via https://github.com/adobe/react-spectrum/commit/74e31fa34386364dde7d62fec3e987f142f892be#diff-5dab6d4552ae847698b818580fc5e362bcd53952faf37a2d66b1b4b65a7f197a)
@CezCz The TableView will try to load in enough items to cover roughly 2 times its height so the codesandbox is actually showing the correct behavior. It definitely shouldn't be loading infinitely though, are there any significant differences between your app's dialog setup and the sandbox? Are new items being indefinitely loaded in in your app or is there an infinite spinner with no items coming in?
In that example, I have enough height to show 5 items. It initially loads 27 items (9 items x 3 API calls). Not seeing any infinite behavior though.
I've reached out to @CezCz and I believe we have a resolution for the infinite loading (had to do with applying a height to the wrapping V2 Provider). The bug that will be fixed here for this issue is a refinement to the TableView virtualizer to prevent it from calling onLoadMore 1 extra time than necessary.
๐ Bug Report
When opening a dialog, the embedded TableView will invoke "loadMore" function several times. https://codesandbox.io/s/brave-merkle-uji7e?file=/src/App.tsx
๐ค Expected Behavior
loadMore is invoked only when needed
๐ฆ Context
I am integrating @quarry/inventory container into a dialog, I have quite a heavy loadMore function which is being triggered indefinitely making my app go non-responsive.
๐งข Your Company/Team
AEM Sites/Odin