소스 검색

Bug Fix: Handle the case which the `interval` is 0.

Naotoshi Fujita 3 년 전
부모
커밋
c46f6248c3
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      dist/js/splide.cjs.js
  2. 1 1
      dist/js/splide.esm.js

+ 1 - 1
dist/js/splide.cjs.js

@@ -479,7 +479,7 @@ function RequestInterval(interval, onInterval, onUpdate, limit) {
 
   function update() {
     if (!paused) {
-      rate = min((now() - startTime) / interval, 1);
+      rate = interval ? min((now() - startTime) / interval, 1) : 1;
       onUpdate && onUpdate(rate);
 
       if (rate >= 1) {

+ 1 - 1
dist/js/splide.esm.js

@@ -474,7 +474,7 @@ function RequestInterval(interval, onInterval, onUpdate, limit) {
 
   function update() {
     if (!paused) {
-      rate = min((now() - startTime) / interval, 1);
+      rate = interval ? min((now() - startTime) / interval, 1) : 1;
       onUpdate && onUpdate(rate);
 
       if (rate >= 1) {