Browse Source

yet another buggy version like for prod

Ivan Asmer 3 years ago
parent
commit
afc424e883
2 changed files with 5 additions and 3 deletions
  1. 3 3
      example/src/index.css
  2. 2 0
      src/SliderSiblingOnly.js

+ 3 - 3
example/src/index.css

@@ -23,6 +23,6 @@ code {
 div {
 }
 
-img {
-    border: 1px dashed black;
-}
+/*img {*/
+    /*border: 1px dashed black;*/
+/*}*/

+ 2 - 0
src/SliderSiblingOnly.js

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