erksch / react-native-wheely

An all JavaScript wheel picker for react-native without any native code.
413 stars 59 forks source link

Fast scroll to top show empty cell when selectedIndex is not 0 #48

Open menghany opened 1 year ago

menghany commented 1 year ago

https://user-images.githubusercontent.com/13767186/218925885-40e4274b-2279-43af-a362-bd9f9c3be82c.mov

menghany commented 1 year ago
const [selectedIndex,setSelectedIndex] = useState(15)
const onWheelChange = index => {
setSelectedIndex(index)
  }
<WheelPicker
      options={options}
      selectedIndicatorStyle={{backgroundColor: '#F6F7F9'}}
      itemHeight={36}
      visibleRest={3}
      selectedIndex={selectedIndex}
      onChange={onWheelChange}
      itemTextStyle={{
        fontSize: 16,
        color: '#333',
        fontWeight: 500
      }}
    />
erksch commented 1 year ago

Thanks for reporting, Is this Android or iOS?

menghany commented 1 year ago

Both Android and iOS