Fixed auto hide components hiding on iOS refresh gesture

This commit is contained in:
Arnaud Vergnet 2020-04-16 18:59:35 +02:00
parent 8b021356b8
commit 31f7a2e539

View file

@ -32,7 +32,8 @@ export default class AutoHideComponent extends React.Component<Props, State> {
}
onScroll({nativeEvent}: Object) {
const speed = this.lastOffset - nativeEvent.contentOffset.y;
const speed = nativeEvent.contentOffset.y < 0 ? 0 : this.lastOffset - nativeEvent.contentOffset.y;
console.log(nativeEvent);
if (speed < -5) { // Go down
if (!this.isAnimationDownPlaying) {
this.isAnimationDownPlaying = true;