Commands on menuitems with submenus aren't triggered in the menu bar

RESOLVED WONTFIX

Status

Mozilla Labs
Jetpack Prototype
RESOLVED WONTFIX
8 years ago
7 years ago

People

(Reporter: adw, Unassigned)

Tracking

(Depends on: 1 bug)

Details

(Reporter)

Description

8 years ago
On OS X only, for menus in the menu bar only, commands on menuitems with submenus are not triggered when ancestor menuitems are clicked.  For example, the following command function is never called when the "foo" and "bar" submenu items are clicked:

  jetpack.menu.add({
    label: "Broken on OS X :(",
    menu: new jetpack.Menu(["foo", "bar"]),
    command: function () console.log("I'm never called")
  });

As a workaround you can define a single function and attach it to "foo" and "bar" directly:

  function myCommand(menuitem) {
    console.log("Clicked " + menuitem.label);
  }
  jetpack.menu.add({
    label: "This Works",
    menu: new jetpack.Menu([
      { label: "foo", command: myCommand },
      { label: "bar", command: myCommand }
    ])
  });

Due to platform bug 534008.  When that's fixed, this one will be, too, but maybe we can come up with a workaround in the meantime.
(Reporter)

Comment 1

8 years ago
Related is bug 526382.
We will be monitoring all these issues after the rebooted Jetpack code base is released in the first week of March to ensure their causes are not duplicated. Many of the bugs/issues with the prototype version of Jetpack will be made irrelevant given the structure of the new SDK.
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.