Skip to content

Support use of role for MenuItem #122

@scope2229

Description

@scope2229

If you use Electron MenuItem role option the error Uncaught TypeError: MenuItem must have at least one of label, role or type is thrown.

To reproduce inside the example instead of using the defaultMenu with TitleBar menu option use the following code

[
    {
      label: 'Menu',
      submenu: [
        {
          id: 'file',
          label: 'File',
          click: () => console.log("File"),
        },{
          role: "editMenu"
        }
      ],
    },
  ]

I think the role needs adding to the MenuItem type along with check the inside validate() not sure what else would be required though

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions