Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed numVisibleItems in Scroller component #280

Merged
merged 1 commit into from
Mar 2, 2021

Conversation

psolom
Copy link
Contributor

@psolom psolom commented Mar 2, 2021

I got the case when numVisibleItems is calculated as 6 instead of 7 days and that is ruins paged scrollable. I found that before Math.floor() being applied the raw value is 6.94 which, I believe, is ok since it's calculated upon rounded itemWidth & marginHorizontal values. But when you floor the numVisibleItems itself it ends up in wrong days & unexpected paging behavior. This PR suggests to replace Math.floor() with Math.round()

I suppose it also could be a fix for issue #269

@peacechen
Copy link
Collaborator

Thanks @psolom 👍

@peacechen peacechen merged commit d37b6f6 into BugiDev:master Mar 2, 2021
@psolom
Copy link
Contributor Author

psolom commented Mar 2, 2021

sure, and take a look #279 please
that's the only thing I need to solve before I can use your plugin in my app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants