|
@@ -60,6 +60,7 @@ export default ({images = [], className, onChange, onClick, ref, current:propCur
|
|
|
|
|
|
const onTouchEnd = () => {
|
|
const onTouchEnd = () => {
|
|
if (!containerRef.current) return
|
|
if (!containerRef.current) return
|
|
|
|
+ if (imgs.length !== images.length) return
|
|
if (inTouch.current){
|
|
if (inTouch.current){
|
|
if (timeout.current) clearInterval(timeout.current)
|
|
if (timeout.current) clearInterval(timeout.current)
|
|
|
|
|
|
@@ -105,6 +106,7 @@ export default ({images = [], className, onChange, onClick, ref, current:propCur
|
|
|
|
|
|
const onScroll = e => {
|
|
const onScroll = e => {
|
|
if (autoscroll.current) return;
|
|
if (autoscroll.current) return;
|
|
|
|
+ if (imgs.length !== images.length) return
|
|
|
|
|
|
if (timeout.current) clearInterval(timeout.current)
|
|
if (timeout.current) clearInterval(timeout.current)
|
|
|
|
|
|
@@ -118,6 +120,7 @@ export default ({images = [], className, onChange, onClick, ref, current:propCur
|
|
|
|
|
|
const onImgClick = (e, i) => {
|
|
const onImgClick = (e, i) => {
|
|
const touchDevice = isTouchDevice()
|
|
const touchDevice = isTouchDevice()
|
|
|
|
+ if (imgs.length !== images.length) return
|
|
if (touchDevice && typeof onClick === 'function'){
|
|
if (touchDevice && typeof onClick === 'function'){
|
|
onClick(i)
|
|
onClick(i)
|
|
}
|
|
}
|