Skip to content

Commit

Permalink
fix: enable property having no effect on submenus (#16858)
Browse files Browse the repository at this point in the history
  • Loading branch information
trop[bot] authored and codebytere committed Feb 9, 2019
1 parent 8b5f26a commit 04158b1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions atom/browser/ui/cocoa/atom_menu_controller.mm
Expand Up @@ -246,6 +246,11 @@ - (void)addItemToMenu:(NSMenu*)menu
[NSApp setServicesMenu:submenu];
} else if (type == atom::AtomMenuModel::TYPE_SUBMENU &&
model->IsVisibleAt(index)) {
// We need to specifically check that the submenu top-level item has been
// enabled as it's not validated by validateUserInterfaceItem
if (!model->IsEnabledAt(index))
[item setEnabled:NO];

// Recursively build a submenu from the sub-model at this index.
[item setTarget:nil];
[item setAction:nil];
Expand Down

0 comments on commit 04158b1

Please sign in to comment.