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

The wheel keeps on scrolling #191

Open
varunchandran333 opened this issue Feb 16, 2021 · 2 comments
Open

The wheel keeps on scrolling #191

varunchandran333 opened this issue Feb 16, 2021 · 2 comments

Comments

@varunchandran333
Copy link

20210211_172239.1.mp4

The number is reset on unchecking the checkbox. Then some time this happens on reset.
What is the best way to reset the number picker?

@varunchandran333 varunchandran333 changed the title The wheel keep on scrolling The wheel keeps on scrolling Feb 16, 2021
@thirstycoda
Copy link

thirstycoda commented Feb 22, 2021

I'm using this control with np_wrapSelectorWheel set to false so I didn't see the same behaviour as you, but I saw a problem which may have the same cause. My problem sometimes occurred when using setValue. Thought I'd post my workaround in case it helps.

So it looks like in the computeScroll() function, it's possible for line 1236 scrollBy(currentScrollerX - mPreviousScrollerX, 0); to be called with the result of currentScollerX - mPreviousScrollerX being something similar to the minimum value of int (-2147483648). This results in the code entering while (mCurrentScrollOffset - mInitialScrollOffset < -gap) { at line 1333 and continue to loop around for a very long time.

I don't know much about the library but I get the impression that the problem may related to mPreviousScrollerX not being reset correctly.

My workaround was to call smoothScroll(false, 0) immediately after using setValue. I used smoothScroll because there is a line in there that sets mPreviousScrollerX to 0.

@varunchandran333
Copy link
Author

same issue exist after smoothscroll

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