Skip to content

Commit f73ca5d

Browse files
committed
Reset initialIndex if invalid one was provided. The plugin fails otherwise.
1 parent 6eb519f commit f73ca5d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/scrollable/scrollable.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,9 @@
308308

309309
// initial index
310310
if (conf.initialIndex) {
311+
if (self.getItems().length <= conf.initialIndex) {
312+
conf.initialIndex = 0;
313+
}
311314
self.seekTo(conf.initialIndex, 0, function() {});
312315
}
313316
}

0 commit comments

Comments
 (0)