Skip to content

Commit c46f624

Browse files
Bug Fix: Handle the case which the interval is 0.
1 parent 3a3b287 commit c46f624

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

dist/js/splide.cjs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ function RequestInterval(interval, onInterval, onUpdate, limit) {
479479

480480
function update() {
481481
if (!paused) {
482-
rate = min((now() - startTime) / interval, 1);
482+
rate = interval ? min((now() - startTime) / interval, 1) : 1;
483483
onUpdate && onUpdate(rate);
484484

485485
if (rate >= 1) {

dist/js/splide.esm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ function RequestInterval(interval, onInterval, onUpdate, limit) {
474474

475475
function update() {
476476
if (!paused) {
477-
rate = min((now() - startTime) / interval, 1);
477+
rate = interval ? min((now() - startTime) / interval, 1) : 1;
478478
onUpdate && onUpdate(rate);
479479

480480
if (rate >= 1) {

0 commit comments

Comments
 (0)