NSMenu's submenu won't call willHighlight method for items using custom views

On a submenu (NSMenu), items that use custom views as part of their layout, do not call NSMenu's delegate willHighlight method. The method is called correctly when placing the same items with custom views inside the root/parent NSMenu.

Steps

  • Create a NSMenu with at least two NSMenuItem; One with a custom view and another without it.
  • Add a submenu to the item without a custom view; make sure to set the submenu's delegate
  • Add multiple items to the submenu; Make sure some of the items are using custom views
  • Using one of NSMenu's delegate method, willHighlight, check if it will return an item when hovering over the custom view items inside the submenu
  • Notice it will only return when hovering over items that do not use a custom view.

Expected Result

  • NSMenu's willHighlight method should be called and inform with item with custom view should be highlighted inside the submenu.

Tests done on macOS 14.3.1 and 14.4.1. Xcode 15.2 and 15.3.

Post not yet marked as solved Up vote post of LucasFrazao Down vote post of LucasFrazao
234 views
Add a Comment