Browse Source

Fixed auto hide components hiding on iOS refresh gesture

Arnaud Vergnet 4 years ago
parent
commit
31f7a2e539
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      src/components/Custom/AutoHideComponent.js

+ 2
- 1
src/components/Custom/AutoHideComponent.js View File

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

Loading…
Cancel
Save