Custom views in menus cause popovers to be closed when a menu item has been selected

Originator:lucas
Number:rdar://32788367 Date Originated:15-Jun-2017 12:31 PM
Status:Open Resolved:
Product:macOS + SDK Product Version:10.12
Classification:UI/Usability Reproducible:Always
 
Area:
AppKit

Summary:
When adding a menu item with a custom view to (context) menu, said menu can't be used when opened in an NSPopover with the behaviour set to NSPopoverBehaviorTransient.

According to the documentation “interacting with menus or panels that become key only when needed will not cause a transient popover to close”. However, as shown by the sample project, this isn’t the case when the menu contains a custom view.

Steps to Reproduce:
- Open and run the attached sample project.
- Click the button that says “Menu With Custom View”.
- Select some text and right-click.
- Try to copy, paste or cut something.

Expected Results:
The selected action should be executed without closing the popover.

Observed Results:
The popover is being closed after the selected action has been executed.

Version:
10.12.5 (16F73)

Notes:
The sample project also contains a button “Default Menu” that shows a popover with the same configuration and view controller, but with a default context menu with no custom view. This popover behaves as expected.

Sample Project:
Window with two buttons, both open a popover containing a text view. Right-clicking the first text view opens a menu containing a custom view, right-clicking the second text view opens the default menu.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!