erksch / react-native-wheely

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

onChange not working with first index? #60

Closed nyplex closed 1 year ago

nyplex commented 1 year ago

It seems that the onChange callback does not return any value when the first option is being selected. Works fine for all the others index in the array.

danielkeithw commented 1 year ago

I am having this issue also -- Did you figure it out?

PartypayNL commented 11 months ago

Same issue, cant reselect the first item.

PartypayNL commented 11 months ago

@nyplex easy fix:

https://github.com/erksch/react-native-wheely/compare/master...danielkeithw:react-native-wheely:master

@erksch I think this should be merged with main

DavidMaza commented 9 months ago

I've also had the above problem where selectedIndex is greater than 0

e.g.

  1. Create a wheel with the values: 0, 1, 2, 3
  2. Set selectedIndex = "1"
  3. Scroll to "2"
  4. onChange() is emitted for "2"
  5. Scroll to "1"
  6. Expected: isChange() is emitted for "1" Actual: onChange() is not emitted

https://github.com/erksch/react-native-wheely/compare/master...danielkeithw:react-native-wheely:master fixes it for me