Acknowledged
CIQQA-3719

Action Menu does not work with touch/mouse in the simulator - app crash

If you use an action menu using the device buttons everything seems to work fine. But if you use touch, i.e. click on the menu itself in the simulator with the mouse, the delegate is called, but the action menu is not popped and stays displayed.

This ultimately results in an app crash when you do use the buttons in an attempt to get off the menu:

selected 1

Error: Unexpected Type Error
Stack: 

Encountered app crash.

Thankfully, it all seems to work correctly on a real device, but means it cannot be tested at all on a touch device like the venu 2 or vivoactive 6.

This is broken in SDK 7.1.0 through to 8.4.0. It last worked in 6.2.4

Parents
  • OK, now I know what's happening in my case.

     yes I tried on venux1, vivoactive6 in the sim, with mouse only. The reason experienced forum users post code (even without others asking them) is because it helps others to reproduce it or to spot the problem and help. Not in this case BUT....

    After I saw flowstate's code I realized, that although contrary to him I do use the 

    setActionMenuIndicator({:enabled => true});
    it turns out, that I am not using ActionMenu. Instead:
    // vivoactive6 has onActionMenu instead of onMenu
    (:action_menu)
    function onActionMenu() {
      return onMenu();
    }
    and there I use Menu or Menu2.
    So this explains why I don't see the crash. On the other hand it might also give you a workaround until it's fixed by Garmin: replace ActionMenu with Menu or Menu2.
    And to follow up on this: what is the reason one would use ActionMenu? Looking at the functionality, it's better to use Menu2: Menu2 is since CIQ 3.0.0 while ActionMenu only since 3.4.0. Menu2 has all the functionalities that ActionMenu has, and some more. There might be slight differences in how it behaves in terms of closing itself automatically, but that is probably not the reason they introduced a new set of classes. So what am I missing here?
Comment
  • OK, now I know what's happening in my case.

     yes I tried on venux1, vivoactive6 in the sim, with mouse only. The reason experienced forum users post code (even without others asking them) is because it helps others to reproduce it or to spot the problem and help. Not in this case BUT....

    After I saw flowstate's code I realized, that although contrary to him I do use the 

    setActionMenuIndicator({:enabled => true});
    it turns out, that I am not using ActionMenu. Instead:
    // vivoactive6 has onActionMenu instead of onMenu
    (:action_menu)
    function onActionMenu() {
      return onMenu();
    }
    and there I use Menu or Menu2.
    So this explains why I don't see the crash. On the other hand it might also give you a workaround until it's fixed by Garmin: replace ActionMenu with Menu or Menu2.
    And to follow up on this: what is the reason one would use ActionMenu? Looking at the functionality, it's better to use Menu2: Menu2 is since CIQ 3.0.0 while ActionMenu only since 3.4.0. Menu2 has all the functionalities that ActionMenu has, and some more. There might be slight differences in how it behaves in terms of closing itself automatically, but that is probably not the reason they introduced a new set of classes. So what am I missing here?
Children
  • That is why I said in my followup, WatchUi.ActionMenu

    Action menu was added as a simple discreet menu to match some new on device behaviour. Unlike Menu2 it pops itself. 

    Why is it better to use Menu2? I want a simple menu with a confirm/cancel option to confirm an action. ActionMenu is perfect for that and exists on all devices I'm developing for right now. On most watches it slides in from the side and only partially covers the screen. It is perfect for that whereas Menu2 is heavyweight. Previously in older apps, I use "has" to pick ActionMenu when it's available, and menu2 when it's not.

    I don't need a workaround, it's a sim only bug which I don't experience when I use the buttons, not touch. Although it appears this is different to FlowState. There are no issues on real devices I've found and have used ActionMenu for years without any reported problems. 

    I guess I'm not experienced enough having been here only a decade.