PedroBern / react-native-collapsible-tab-view

A cross-platform Collapsible Tab View component for React Native
MIT License
836 stars 162 forks source link

fix: handle scroll to top ios #76

Closed andreialecu closed 3 years ago

andreialecu commented 3 years ago

Fixes #66

Open for discussion. I didn't notice any breakage from doing it this way.

The idea behind it is that if we detect onScroll being called, then we set isScrolling to 1. Once onScroll stops firing then it is set back to 0.

This has the benefit and side effect that other types of scroll besides those initiated by onBeginDrag are handled by default (such as programatic scrolls)

andreialecu commented 3 years ago

This also differs from the current implementation. With this change, isScrolling will only be set to a falsy value after the momentum scroll completely finishes (as opposed to immediately after the user lifts the finger).

However, I tested iOS and I didn't notice anything breaking. (didn't test Android)

PedroBern commented 3 years ago

Genius solution 👍 Everything is working on android.