Prechádzať zdrojové kódy

18 react update and prerender check

asmer 3 mesiacov pred
rodič
commit
40820d7982
1 zmenil súbory, kde vykonal 3 pridanie a 1 odobranie
  1. 3 1
      src/SliderSiblingOnly.js

+ 3 - 1
src/SliderSiblingOnly.js

@@ -33,8 +33,10 @@ export default ({images = [], imgWidth=377, className, onChange, onClick, ref, s
 
 
     const onTouchEnd = () => {
-        if (!containerRef.current)
+        if (!containerRef.current){
             setTimeout(onTouchEnd, 20)
+            return
+        }
         // console.log('TOUCH END', inTouch.current, autoscroll.current, afterAutoscroll.current, 
         //                          containerRef.current.scrollLeft, containerRef.current.scrollWidth)
         if (inTouch.current){