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

translationY becomes NaN sometimes when scrolling a lot #21

Open
appfrilans opened this issue Aug 25, 2023 · 3 comments
Open

translationY becomes NaN sometimes when scrolling a lot #21

appfrilans opened this issue Aug 25, 2023 · 3 comments

Comments

@appfrilans
Copy link

I have this issue with BouncyRecyclerview that that translationY becomes NaN sometimes. It is kind of hard to reproduce but happens regularly. I fling the view upwards a lot until it happens. Then the full content of the RecyclerView disappears. If I check with it in the LayoutInspector I can see that translationY is not 0dp but NaN which I assume is the issue.

@appfrilans
Copy link
Author

Found the issue. In BoundyRecyclerView:

override fun onPull(deltaDistance: Float, displacement: Float)

is called with deltaDistance as NaN. There should be a check here to not do anything for this case. The origin seems to be

onPullDistance in EdgeEffectCompact calling onPullDistance with 0 as deltaDistance. Not sure why 0 is converted to NaN though.

@Uros1616
Copy link

Same problem here but was unable to fix the issue. When using onOverPullTop, in some scenarios the deltaDistance is NaN. Can't seem to find the solution, even tried setting the value if NaN occurs.
Help if you can! :)

@Uros1616
Copy link

Turns out the problem for me was implementation 'androidx.recyclerview:recyclerview:1.3.1'.
On version 1.2.1 it's working fine

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

No branches or pull requests

2 participants