Skip to content

Commit 69a7662

Browse files
committed
πŸ— v2.3.0
1 parent 2b36649 commit 69a7662

8 files changed

+35
-34
lines changed

β€Žcss/flickity.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Flickity v2.2.2
1+
/*! Flickity v2.3.0
22
https://flickity.metafizzy.co
33
---------------------------------------------- */
44

β€Ždist/flickity.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Flickity v2.2.2
1+
/*! Flickity v2.3.0
22
https://flickity.metafizzy.co
33
---------------------------------------------- */
44

β€Ždist/flickity.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Ždist/flickity.pkgd.js

+21-20
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Flickity PACKAGED v2.2.2
2+
* Flickity PACKAGED v2.3.0
33
* Touch, responsive, flickable carousels
44
*
55
* Licensed GPLv3 for open source use
@@ -813,6 +813,7 @@ proto.create = function() {
813813
this.element.setAttribute( 'aria-hidden', 'true' );
814814
this.x = 0;
815815
this.shift = 0;
816+
this.element.style[ this.parent.originSide ] = 0;
816817
};
817818

818819
proto.destroy = function() {
@@ -821,6 +822,7 @@ proto.destroy = function() {
821822
this.element.style.position = '';
822823
var side = this.parent.originSide;
823824
this.element.style[ side ] = '';
825+
this.element.style.transform = '';
824826
this.element.removeAttribute('aria-hidden');
825827
};
826828

@@ -843,8 +845,14 @@ proto.updateTarget = proto.setDefaultTarget = function() {
843845

844846
proto.renderPosition = function( x ) {
845847
// 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 ) + ')';
848856
};
849857

850858
proto.select = function() {
@@ -1934,7 +1942,8 @@ proto.onresize = function() {
19341942
utils.debounceMethod( Flickity, 'onresize', 150 );
19351943

19361944
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 ) {
19381947
return;
19391948
}
19401949
this.getSize();
@@ -2087,7 +2096,7 @@ return Flickity;
20872096
} ) );
20882097

20892098
/*!
2090-
* Unipointer v2.3.0
2099+
* Unipointer v2.4.0
20912100
* base class for doing one thing with pointer event
20922101
* MIT license
20932102
*/
@@ -2148,12 +2157,13 @@ proto._bindStartEvent = function( elem, isAdd ) {
21482157

21492158
// default to mouse events
21502159
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 ) {
21522165
// Pointer Events
21532166
startEvent = 'pointerdown';
2154-
} else if ( 'ontouchstart' in window ) {
2155-
// Touch Events. iOS Safari
2156-
startEvent = 'touchstart';
21572167
}
21582168
elem[ bindMethod ]( startEvent, this );
21592169
};
@@ -2389,7 +2399,7 @@ return Unipointer;
23892399
}));
23902400

23912401
/*!
2392-
* Unidragger v2.3.1
2402+
* Unidragger v2.4.0
23932403
* Draggable base class
23942404
* MIT license
23952405
*/
@@ -2725,21 +2735,12 @@ proto._touchActionValue = 'pan-y';
27252735

27262736
// -------------------------- -------------------------- //
27272737

2728-
var isTouch = 'createTouch' in document;
2729-
var isTouchmoveScrollCanceled = false;
2730-
27312738
proto._createDrag = function() {
27322739
this.on( 'activate', this.onActivateDrag );
27332740
this.on( 'uiChange', this._uiChangeDrag );
27342741
this.on( 'deactivate', this.onDeactivateDrag );
27352742
this.on( 'cellChange', this.updateDraggable );
27362743
// 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-
}
27432744
};
27442745

27452746
proto.onActivateDrag = function() {
@@ -3959,7 +3960,7 @@ return Flickity;
39593960
} ) );
39603961

39613962
/*!
3962-
* Flickity v2.2.2
3963+
* Flickity v2.3.0
39633964
* Touch, responsive, flickable carousels
39643965
*
39653966
* Licensed GPLv3 for open source use

β€Ždist/flickity.pkgd.min.js

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žjs/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Flickity v2.2.2
2+
* Flickity v2.3.0
33
* Touch, responsive, flickable carousels
44
*
55
* Licensed GPLv3 for open source use

β€Žpackage-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žpackage.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flickity",
3-
"version": "2.2.2",
3+
"version": "2.3.0",
44
"description": "Touch, responsive, flickable carousels",
55
"main": "js/index.js",
66
"style": "css/flickity.css",

0 commit comments

Comments
Β (0)