Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS 13 bugfix #1009

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

iOS 13 bugfix #1009

wants to merge 1 commit into from

Conversation

henrybarn
Copy link

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

@HandHugs
Copy link

HandHugs commented Jan 9, 2020

please merge! This should have been fixed a long time ago.

@newsustainableperspectives

Hello. We have also some issues with IOS13 and swiping. Please merge. Thanks in advance

@cezr
Copy link

cezr commented Jan 30, 2020

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.

@106firestarter
Copy link

Hey. If someone could merge and fix this, that would be great.

@HandHugs
Copy link

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...

@desandro
Copy link
Member

desandro commented Mar 25, 2020

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

IMG_90B24F99C13E-1


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 ] );
};

@henrybarn
Copy link
Author

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?

Flickity · Events

@whataboutpereira
Copy link

I can confirm that the issue persists in Safari in iOS 14.4.1...

@vasanthangel4
Copy link

@desandro: NO movement on their carousel at all. iOS 15.0.1 & 14.0 scrolling is not working. could you please help on this,.

@vasanthangel4
Copy link

@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. <script type="text/javascript">
var $carousel = $('.carousel').flickity();

$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();

}
});

</script>

@vasanthangel4
Copy link

vasanthangel4 commented Nov 2, 2021

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.

@whataboutpereira
Copy link

Any chance of getting this merged and released? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Flickity Carousels don't "flick" easily in iOS 13
10 participants