1
1
/*!
2
- * Flickity PACKAGED v2.2.2
2
+ * Flickity PACKAGED v2.3.0
3
3
* Touch, responsive, flickable carousels
4
4
*
5
5
* Licensed GPLv3 for open source use
@@ -813,6 +813,7 @@ proto.create = function() {
813
813
this . element . setAttribute ( 'aria-hidden' , 'true' ) ;
814
814
this . x = 0 ;
815
815
this . shift = 0 ;
816
+ this . element . style [ this . parent . originSide ] = 0 ;
816
817
} ;
817
818
818
819
proto . destroy = function ( ) {
@@ -821,6 +822,7 @@ proto.destroy = function() {
821
822
this . element . style . position = '' ;
822
823
var side = this . parent . originSide ;
823
824
this . element . style [ side ] = '' ;
825
+ this . element . style . transform = '' ;
824
826
this . element . removeAttribute ( 'aria-hidden' ) ;
825
827
} ;
826
828
@@ -843,8 +845,14 @@ proto.updateTarget = proto.setDefaultTarget = function() {
843
845
844
846
proto . renderPosition = function ( x ) {
845
847
// render position of cell with in slider
846
- var side = this . parent . originSide ;
847
- this . element . style [ side ] = this . parent . getPositionValue ( x ) ;
848
+ var sideOffset = this . parent . originSide === 'left' ? 1 : - 1 ;
849
+
850
+ var adjustedX = this . parent . options . percentPosition ?
851
+ x * sideOffset * ( this . parent . size . innerWidth / this . size . width ) :
852
+ x * sideOffset ;
853
+
854
+ this . element . style . transform = 'translateX(' +
855
+ this . parent . getPositionValue ( adjustedX ) + ')' ;
848
856
} ;
849
857
850
858
proto . select = function ( ) {
@@ -1934,7 +1942,8 @@ proto.onresize = function() {
1934
1942
utils . debounceMethod ( Flickity , 'onresize' , 150 ) ;
1935
1943
1936
1944
proto . resize = function ( ) {
1937
- if ( ! this . isActive ) {
1945
+ // #1177 disable resize behavior when animating or dragging for iOS 15
1946
+ if ( ! this . isActive || this . isAnimating || this . isDragging ) {
1938
1947
return ;
1939
1948
}
1940
1949
this . getSize ( ) ;
@@ -2087,7 +2096,7 @@ return Flickity;
2087
2096
} ) ) ;
2088
2097
2089
2098
/*!
2090
- * Unipointer v2.3 .0
2099
+ * Unipointer v2.4 .0
2091
2100
* base class for doing one thing with pointer event
2092
2101
* MIT license
2093
2102
*/
@@ -2148,12 +2157,13 @@ proto._bindStartEvent = function( elem, isAdd ) {
2148
2157
2149
2158
// default to mouse events
2150
2159
var startEvent = 'mousedown' ;
2151
- if ( window . PointerEvent ) {
2160
+ if ( 'ontouchstart' in window ) {
2161
+ // HACK prefer Touch Events as you can preventDefault on touchstart to
2162
+ // disable scroll in iOS & mobile Chrome metafizzy/flickity#1177
2163
+ startEvent = 'touchstart' ;
2164
+ } else if ( window . PointerEvent ) {
2152
2165
// Pointer Events
2153
2166
startEvent = 'pointerdown' ;
2154
- } else if ( 'ontouchstart' in window ) {
2155
- // Touch Events. iOS Safari
2156
- startEvent = 'touchstart' ;
2157
2167
}
2158
2168
elem [ bindMethod ] ( startEvent , this ) ;
2159
2169
} ;
@@ -2389,7 +2399,7 @@ return Unipointer;
2389
2399
} ) ) ;
2390
2400
2391
2401
/*!
2392
- * Unidragger v2.3.1
2402
+ * Unidragger v2.4.0
2393
2403
* Draggable base class
2394
2404
* MIT license
2395
2405
*/
@@ -2725,21 +2735,12 @@ proto._touchActionValue = 'pan-y';
2725
2735
2726
2736
// -------------------------- -------------------------- //
2727
2737
2728
- var isTouch = 'createTouch' in document ;
2729
- var isTouchmoveScrollCanceled = false ;
2730
-
2731
2738
proto . _createDrag = function ( ) {
2732
2739
this . on ( 'activate' , this . onActivateDrag ) ;
2733
2740
this . on ( 'uiChange' , this . _uiChangeDrag ) ;
2734
2741
this . on ( 'deactivate' , this . onDeactivateDrag ) ;
2735
2742
this . on ( 'cellChange' , this . updateDraggable ) ;
2736
2743
// TODO updateDraggable on resize? if groupCells & slides change
2737
- // HACK - add seemingly innocuous handler to fix iOS 10 scroll behavior
2738
- // #457, RubaXa/Sortable#973
2739
- if ( isTouch && ! isTouchmoveScrollCanceled ) {
2740
- window . addEventListener ( 'touchmove' , function ( ) { } ) ;
2741
- isTouchmoveScrollCanceled = true ;
2742
- }
2743
2744
} ;
2744
2745
2745
2746
proto . onActivateDrag = function ( ) {
@@ -3959,7 +3960,7 @@ return Flickity;
3959
3960
} ) ) ;
3960
3961
3961
3962
/*!
3962
- * Flickity v2.2.2
3963
+ * Flickity v2.3.0
3963
3964
* Touch, responsive, flickable carousels
3964
3965
*
3965
3966
* Licensed GPLv3 for open source use
0 commit comments