Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Device API onmouseup() Bug?

ANSWERED

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.

Peter McLennan
Gondwana Software
Best Answer
1 BEST ANSWER

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.

View best answer in original post

Best Answer
8 REPLIES 8

var y = 0;

 

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

y = evt.screenY;
}

Best Answer
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.

Best Answer

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.

Peter McLennan
Gondwana Software
Best Answer

Have the same issue and no workaround (so far). I need to kick off setInterval while screen is pressed and clear the interval when it's no longer pressed. Basic stuff, really annoying that it doesn't work

Best Answer
0 Votes

From discord:

"orviwan (JonFitbit):something weird, if the rect is fullscreen, there are certain parts where you can touch and the mouseup doesn't trigger immediately, other parts it does"


Orviwan has submitted an official bug report.

Peter McLennan
Gondwana Software
Best Answer

Thanks for posting! 

 

Thought I was doing something wrong till I found this posting. 🙂 

Best Answer

Another workaround is to simply use the onClick event in place of the onMouseUp event since in this context they are equivalent.

Best Answer
0 Votes

The next firmware update will have a fix for this issue, and no, I don't have a specific release date yet.

Best Answer