Cancel
Showing results for 
Search instead for 
Did you mean: 

Device API onmouseup() Bug?

SOLVED

It seems to me that onmouseup() is fired shortly after onmousedown() even if one's finger remains on the screen (as though the event is emulating a simple click). After onmouseup(), onmousemove() events can continue to occur, which shouldn't happen on a touch-screen device.

 

This makes drag-and-drop or swipe gestures rather kludgy to implement. It would be useful if onmouseup() fired when one's finger was uplifted.

 

The relevant documentation is here.

Gondwana Software
Accepted Solution
0 Votes
1 ACCEPTED SOLUTION

Accepted Solutions

That's a workaround I use. It's pretty crappy but it sort of works. There is definitely a bug in the onmouseup and onmousedown Touch Events where both fire simultaneously regardless of which way you swipe. Hopefully that gets fixed soon.

Accepted Solution
3 REPLIES

var y = 0;

 

scrollableArea.onmousemove = function(evt) {
if (evt.screenY < y) {
doDownAction();
}
else if (evt.screenY > y) {
doUpAction();
}

y = evt.screenY;
}

Accepted Solution
0 Votes

That's a workaround I use. It's pretty crappy but it sort of works. There is definitely a bug in the onmouseup and onmousedown Touch Events where both fire simultaneously regardless of which way you swipe. Hopefully that gets fixed soon.

Accepted Solution

Thanks for the confirmation. For my purposes, I had to use a timeout to see when onmousemove() events stopped happening. This means reduced responsiveness.

 

Your solution would avoid such unresponsiveness.

Gondwana Software
Accepted Solution