Просмотр исходного кода

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

Naotoshi Fujita 2 лет назад
Родитель
Сommit
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;
       }