You are reading a single comment by @rigrig and its replies.
Click here to read the full conversation.
-
Hi @rigrig ,
thanks for explaining (or guessing…) what's going on! Can't have been too wrong, as
setTimeout(showMenu,0)
did not help, butsetTimeout(showMenu,10)
actually does! With 10 milisconds delay the events seem to be correctly assigned. Very cool!Best regards,
Dirk
Just a wild guess:
1) Touching the screen first fires a
drag
event, and later atouch
2)
dragger
opens the menu3) the menu sets up both
drag
andtouch
handlers: https://github.com/espruino/Espruino/blob/master/libs/js/banglejs/Bangle_setUI_Q3.js#L46-L484) firing the
drag
event finishes5) Now the
touch
event is fired and handled by theshowMenu->setUI
code (possibly this doesn't happen if you drag outside the window or drag/touch in just the "right" way)A possible solution might be changing
showMenu();
tosetTimeout(showMenu,0);
, so all handlers get a chance to fire before the menu is set up.