adammcarth / react-native-segmented-picker

Selection picker wheel with multi-column support and optional native dependencies.
MIT License
96 stars 31 forks source link

Fix crash when using visbile prop to show/hide #9

Closed adammcarth closed 4 years ago

adammcarth commented 4 years ago

This patch should fix issue #7.

It fixes a crash which happens when using the visible prop to control visibility. The library was trying to fade out the component after it was being hidden due to a logic error in the previous "isVisible()" function which returned true too early.

I have also implemented some updates to make the closing of the picker smoother on iOS, regardless of whether you're using the visible prop or the ref.hide() method directly.

This wasn't picked up previously because of the way the react-native-animatable is mocked in the unit tests using fake timers. I will also make sure that there's a proper example added to the examples project to ensure this is now fully working as expected.