Closed psolom closed 3 years ago
That would be a useful addition. Would you be able to submit a PR for this too? Please create a dedicated function for the onMomentumScrollEnd
callback to make the JSX easier to read.
Done. It would be great if you make a new release after merge.
This has been published in 2.2.0
The linter caught a bug which I fixed in a follow-on commit. visibleStartIndex
and visibleEndIndex
were not declared in onScrollBeginDrag. Does the pre-commit hook not run on your system? The post-install script may not run immediately after forking or cloning the repo.
My bad. I was out of my IDE at that moment so I made commits directly in GitHub UI. Not the most convenient way I must admit. Anyhow thank you for fixing it and the new release.
Hey @peacechen, thanks for the great plugin.
I use scrollable + paging and I would like to get correct start and end moment dates. Seems that
onWeekChanged
fires only at specific conditions, for instance when you step into another week or month while scrolling without paging. But when one enablesscrollerPaging
it's reasonable he would expect the event fires on scroll stops (onMomentumScrollEnd).If you try to rely on
onWeekChanged
to get start/end days it appears that it's unreliable way becauseonWeekChanged
doesn't fire on each day. It took me a lot of time to understand that, because the whole thing looked like the callback function just skipping some days and the behavior is buggy in general.My suggestion is to add
onMomentumScrollEnd
to the at Scroller.js and create another callback prop (onWeekScrolled
e.g.) and fire it inside ofonMomentumScrollEnd
.That is how it could be: