• Just a wild guess:
    1) Touching the screen first fires a drag event, and later a touch
    2) dragger opens the menu
    3) the menu sets up both drag and touch handlers: https://github.com/espruino/Espruino/blob/master/libs/js/banglejs/Bangle_setUI_Q3.js#L46-L48
    4) firing the drag event finishes
    5) Now the touch event is fired and handled by the showMenu->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(); to setTimeout(showMenu,0);, so all handlers get a chance to fire before the menu is set up.

  • Hi @rigrig ,

    thanks for explaining (or guessing…) what's going on! Can't have been too wrong, as setTimeout(showMenu,0) did not help, but setTimeout(showMenu,10) actually does! With 10 milisconds delay the events seem to be correctly assigned. Very cool!

    Best regards,
    Dirk

About

Avatar for rigrig @rigrig started