Skip to content

Commit

Permalink
🐞 fix dragging images, #567
Browse files Browse the repository at this point in the history
  check for pointerType for Chrome Pointer Events

🐞 fix mobile Chrome dragging, #521
  remove pointerdown as touchstart event
  • Loading branch information
desandro committed Aug 28, 2017
1 parent c21fdfe commit d2ab828
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions js/drag.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,20 +162,16 @@ proto.pointerDownFocus = function( event ) {
}
};

var touchStartEvents = {
touchstart: true,
pointerdown: true,
};

var focusNodes = {
INPUT: true,
SELECT: true,
};

function getCanPointerDown( event ) {
var isTouchStart = touchStartEvents[ event.type ];
var isTouchStart = event.type == 'touchstart';
var isTouchPointer = event.pointerType == 'touch';
var isFocusNode = focusNodes[ event.target.nodeName ];
return isTouchStart || isFocusNode;
return isTouchStart || isTouchPointer || isFocusNode;
}

proto.canPreventDefaultOnPointerDown = function( event ) {
Expand Down
2 changes: 1 addition & 1 deletion sandbox/media.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ <h1>media</h1>
<!-- <script src="../dist/flickity.pkgd.js"></script> -->

<script>
docReady( function() {
fizzyUIUtils.docReady( function() {

// var imgLoad = imagesLoaded('#image-gallery1');
var flkty1 = Flickity.data('#image-gallery1');
Expand Down

0 comments on commit d2ab828

Please sign in to comment.