You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i compared firefox (linux) and samsung internet, preventDefault does not do the same thing. I use a workaround:
ne.addEventListener('long-press', function(e){
if(!this.havePointer)
return;
//e.preventDefault(); // works in firefox/linux: (pending) click is not fired,
// but not in samsung internet: new clicks (handlers are accumulated!) are suppressed.
// workaround:
function suppressEvent(e){
document.removeEventListener('click', suppressEvent, true);
e.stopImmediatePropagation();
e.preventDefault();
e.stopPropagation();
}
document.addEventListener('click', suppressEvent, true);
document.addEventListener('pointerdown', function removeSuppressor(e){
document.removeEventListener('pointerdown', removeSuppressor, true);
document.removeEventListener('click', suppressEvent, true);
}, true);
// actual handler...
});
ne.addEventListener('pointerleave', function(e){
this.havePointer=false;
});
ne.addEventListener('pointerenter', function(e){
this.havePointer=true;
});
The text was updated successfully, but these errors were encountered:
hi john, sorry for coming back to this so late (i was away from the inet for weeks). actually, last time, i wanted to point out 2 separate issues, the workaround above takes care of both. the first is that preventDefault() does not the same thing in different browsers, the second issue is that if the event handler is attached to an element, the long-press event also fires when swiping over the element.
i compared firefox (linux) and samsung internet, preventDefault does not do the same thing. I use a workaround:
The text was updated successfully, but these errors were encountered: