Skip to content

Commit

Permalink
Prevent ignored touches on Android Chrome.
Browse files Browse the repository at this point in the history
Android Crhome will not trigger a click event if a user drags an item,
even if the item is dropped back into its original placement. This
means that whenever the "ignore next click" handling is activated, the
user's _next_ click (unrelated to dragging) will be ignored.

This commit solves this by never activating the "ignore next click"
handling on Android Chrome.
  • Loading branch information
itsjohncs committed Oct 19, 2021
1 parent daaefed commit cf04481
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ let dragEl,


// #1184 fix - Prevent click event on fallback if dragged but item not changed position
if (documentExists) {
if (documentExists && !ChromeForAndroid) {
document.addEventListener('click', function(evt) {
if (ignoreNextClick) {
evt.preventDefault();
Expand Down

0 comments on commit cf04481

Please sign in to comment.