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

Fix WheelPicker visual bug by setting offset in onValueChange #3508

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BastianGanze
Copy link

Description

Which item is visually highlighted is controlled by const offset = useSharedValue(0);.
This value is currently only set inside useAnimatedScrollHandler.
In some configurations the scroll handler will not be called when scrolling very fast, especially when scrolling fast to the end of the list.

Changelog

Set the value of offset in onValueChange to force the visual appearence to be congruent with the current selection in case something goes awry with the animated scroll handler.

Additional info

This will alleviate the issue described in #2939.
One could also imagine a withTiming to smoothen the visual effect. I tried this and liked it but it also increased the delay until the highlight and the selected value were in sync.

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.

1 participant