Skip to content

Commit

Permalink
fix: enable property having no effect on submenus (#16835)
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Feb 9, 2019
1 parent d16b581 commit 1898f91
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions atom/browser/ui/cocoa/atom_menu_controller.mm
Original file line number Diff line number Diff line change
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 1898f91

Please sign in to comment.