浏览代码

Bug Fix: Failed to include the first slide while checking the end index.

Naotoshi Fujita 2 年之前
父节点
当前提交
50e342d8ec
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/js/components/Controller/Controller.ts

+ 1 - 1
src/js/components/Controller/Controller.ts

@@ -298,7 +298,7 @@ export function Controller( Splide: Splide, Components: Components, options: Opt
   function getEnd(): number {
     let end = slideCount - ( hasFocus() || ( isLoop && perMove ) ? 1 : perPage );
 
-    while ( compact && --end > 0 ) {
+    while ( compact && end-- > 0 ) {
       if ( toPosition( slideCount - 1, true ) !== toPosition( end, true ) ) {
         end++;
         break;