flickity
flickity copied to clipboard
iOS 13 bugfix
It looks like dragMove and dragEnd are both called on dragEnd in iOS 13. previousDragX and dragX become the same value because of the dragMove call. dragEndBoostSelect when called, evaluates to zero.
This primitive solution only reassigns previousDragX when dragX is changing.
Fixes: #992 #959
please merge! This should have been fixed a long time ago.
Hello. We have also some issues with IOS13 and swiping. Please merge. Thanks in advance
Hello. I experienced this issue for a project and testing from an iPhone X and iOS 13. I've tested and this does remedy all fixes related.
Hey. If someone could merge and fix this, that would be great.
Does anyone know a way that I can use this as a patch ? Has it been merged? sorry I am not sure if I'm understanding correctly about how this works...
Add a 👍 reaction to this issue if you would like to see this feature added. Do not add +1 comments — They will be deleted
Thanks so much for this contribution and for digging into this problem. I'm having trouble reproducing the issue. Testing with iOS 13.3.1. Can you go to Flickity Events Demo and share a screen capture of the output?
I was not able to trigger pointerMove
at the same time as pointerUp
In the meantime, if anyone needs this fix immediately, you can add it as a duck punch. Add this code:
Flickity.prototype.dragMove = function( event, pointer, moveVector ) {
if ( !this.isDraggable ) {
return;
}
event.preventDefault();
// reverse if right-to-left
var direction = this.options.rightToLeft ? -1 : 1;
if ( this.options.wrapAround ) {
// wrap around move. #589
moveVector.x = moveVector.x % this.slideableWidth;
}
var dragX = this.dragStartPosition + moveVector.x * direction;
if ( !this.options.wrapAround && this.slides.length ) {
// slow drag
var originBound = Math.max( -this.slides[0].target, this.dragStartPosition );
dragX = dragX > originBound ? ( dragX + originBound ) * 0.5 : dragX;
var endBound = Math.min( -this.getLastSlide().target, this.dragStartPosition );
dragX = dragX < endBound ? ( dragX + endBound ) * 0.5 : dragX;
}
if ( this.dragX !== dragX ) {
this.previousDragX = this.dragX;
}
this.dragX = dragX;
this.dragMoveTime = new Date();
this.dispatchEvent( 'dragMove', event, [ pointer, moveVector ] );
};
Thank you, excellent job on the documentation getting setup wasn't hard at all. This is a screenshot taken after I got the bug to fire, swiping from 1 to 2. I hope it's useful. I don't see a dragEnd call, maybe the event was canceled because the browser picked up slight intent to scroll?
I can confirm that the issue persists in Safari in iOS 14.4.1...
@desandro: NO movement on their carousel at all. iOS 15.0.1 & 14.0 scrolling is not working. could you please help on this,.
@DanArthurGallagher: i have using vanilla javascript. i have updated like this as well. but after add this code also iOS 15 scroll is not woking.
$carousel.on( 'dragStart.flickity', function( event, pointer ) {
document.ontouchmove = function (e) { e.preventDefault(); } }); $carousel.on( 'dragEnd.flickity', function( event, pointer ) { document.ontouchmove = function (e) { return true; e.preventDefault();
} });
flickity not at all working in ios 15. no solution helping for ios 15 intermittent not scrolling in mobile device issue there. please dont advertise everyone flickity will work on all the devices. we have reported this issue many times.
Any chance of getting this merged and released? Thanks!