Skip to content

Commit

Permalink
Attempt to fix IOS double clicks
Browse files Browse the repository at this point in the history
  • Loading branch information
RomRider committed Jan 7, 2020
1 parent 94e53b7 commit 23fda43
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/long-press.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ class LongPress extends HTMLElement implements LongPress {
const isIpadOS = navigator.platform === 'MacIntel'
&& navigator.maxTouchPoints > 1
&& !window.MSStream;
if (!isIpadOS) {
const isIOS = /iPad|iPhone|iPod/.test(navigator.platform);
if (!(isIpadOS || isIOS)) {
element.addEventListener('mousedown', clickStart, { passive: true });
element.addEventListener('click', clickEnd);
}
Expand Down

0 comments on commit 23fda43

Please sign in to comment.