keiya01 / react-simple-wheel-picker

react-simple-wheel-picker is simple and smooth component for React
MIT License
9 stars 8 forks source link

Wheel does not scroll to default value when "resetting" selectedID (reset feature) #62

Open eskahel opened 2 years ago

eskahel commented 2 years ago

Hello, I'm using "react": "^16.13.1", I use a WheelPicker with height = itemHeight so that only one item value is displayed.

When I scroll to a given item everything works fine.

When I programmatically change the selectedID value I expect the wheel to automatically scroll to the corresponding value. But the displayed value is still the one that was previously selected. Though the item is not active anymore. (activeColor is properly applied)

In other words, the selectedID value seems to only be used at first rendering

Am I doing something wrong ?