-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Description
Hello,
I started to use this library, everything works fine until I need to set a selectedIndex .
Here the code:
const [selectedIndex, setSelectedIndex] = useState(10)
const {t} = useTranslation('account')
const options = useRef(
Array.from(
{length: MAX_WEEK - MIN_WEEK + 1},
(_, index) => `${t('changeYourPregnancyWeek.week')} ${index + MIN_WEEK}`
)
)
const onChangeOption = useCallback((index: number) => {
setSelectedIndex(index)
}, [])
return (
<WheelPicker
selectedIndex={selectedIndex}
options={options.current}
onChange={onChangeOption}
/>
)
}
What happens is:
Registrazione.schermo.2023-10-26.alle.09.44.25.mov
It happens for me on both platform.
I try to investigate a bit and apparently setting the animated option to true inside the scrollToIndex methods fixes the problem
evrrnv and VLadislav9607
Metadata
Metadata
Assignees
Labels
No labels