{"action":"opened","issue":{"url":"https://api.github.com/repos/electron/electron/issues/12816","repository_url":"https://api.github.com/repos/electron/electron","labels_url":"https://api.github.com/repos/electron/electron/issues/12816/labels{/name}","comments_url":"https://api.github.com/repos/electron/electron/issues/12816/comments","events_url":"https://api.github.com/repos/electron/electron/issues/12816/events","html_url":"https://github.com/electron/electron/issues/12816","id":319922878,"number":12816,"title":"[2.0] MenuItem initialized as `visible: false` can't be found","user":{"login":"magne4000","id":1098371,"avatar_url":"https://avatars0.githubusercontent.com/u/1098371?v=4","gravatar_id":"","url":"https://api.github.com/users/magne4000","html_url":"https://github.com/magne4000","followers_url":"https://api.github.com/users/magne4000/followers","following_url":"https://api.github.com/users/magne4000/following{/other_user}","gists_url":"https://api.github.com/users/magne4000/gists{/gist_id}","starred_url":"https://api.github.com/users/magne4000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magne4000/subscriptions","organizations_url":"https://api.github.com/users/magne4000/orgs","repos_url":"https://api.github.com/users/magne4000/repos","events_url":"https://api.github.com/users/magne4000/events{/privacy}","received_events_url":"https://api.github.com/users/magne4000/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-03T13:33:55Z","updated_at":"2018-05-03T13:33:55Z","closed_at":null,"author_association":"NONE","body":"* Electron version: 2.0.0\r\n* Operating system: MacOS 10.13.4\r\n\r\n* Last known working Electron version: 1.8.4\r\n\r\n### Expected behavior\r\nWhen a submenu item is initialized with `visible: false`, it should be retrievable with `getMenuItemById` or by iterating through `menu.items`.\r\n\r\n### Actual behavior\r\nThose items can't be found\r\n\r\n### How to reproduce\r\n```javascript\r\n{\r\n      label: 'View',\r\n      submenu: [\r\n        {\r\n          id: 'show-teammates-bar',\r\n          label: 'Show Teammates Sidebar',\r\n          type: 'checkbox',\r\n          visible: false,\r\n          checked: true,\r\n          click() {\r\n            ...\r\n          },\r\n        },\r\n        {\r\n          type: 'separator',\r\n        },\r\n       {\r\n          label: 'Show All',\r\n          selector: 'unhideAllApplications:',\r\n        }\r\n      ],\r\n    };\r\n```\r\nIn this example, `show-teammates-bar` can't be retrieved, but if initialized with `visible: true`, and set to `false` once build, it works as expected.\r\n"}}
{"actor":{"display_login":"magne4000"}}