petyosi / react-virtuoso

The most powerful virtual list component for React
https://virtuoso.dev
MIT License
5.16k stars 299 forks source link

[BUG] Wrong endReached index passed from GroupedVirtuoso #985

Open execto opened 12 months ago

execto commented 12 months ago

There is wrong endReached index passed from GroupedVirtuoso.

Reproduction: https://codesandbox.io/s/epic-brattain-np7dsp?file=/App.js

To Reproduce Go to the end of list, and see console output. There is last index of element is 522 (logged by endReached callback), but real item index is 499. GroupedVirtuoso counts also group headers as items.

Expected behavior Pass to endReached last real item index.

Environment Web: Google Chrome Version 116.0.5845.110 (Official Build) (64-bit) Forked from here https://virtuoso.dev/scroll-to-group/ and only added endReached callback