浏览代码

Bug Fix: The end index can be rarely incorrect because of float numbers comparison.

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

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

@@ -334,7 +334,7 @@ export const Controller: ComponentConstructor<ControllerComponent> = ( Splide, C
     let end = slideCount - ( hasFocus() || ( isLoop && perMove ) ? 1 : perPage );
 
     while ( omitEnd && end-- > 0 ) {
-      if ( toPosition( slideCount - 1 ) !== toPosition( end ) ) {
+      if ( ! approximatelyEqual( toPosition( slideCount - 1 ), toPosition( end ), 0.01 ) ) {
         end++;
         break;
       }