Glitchy animation of pop-up button menu item state

Originator:rix.rob
Number:rdar://18955076 Date Originated:12-Nov-2014 09:41 AM
Status:Open Resolved:
Product:OS X SDK Product Version:Mac OS X 10.10.1 (14B23)
Classification:Other Bug Reproducible:Always
 
Summary:
When a pop-up button’s menu items are laid out differently in the menu than in the button, the second-last frame of the selection animation—drawn within the button—is of their menu state, before jumping to the state shown in the button. This ends up looking glitchy.


Steps to Reproduce:
1. Open the attached project.
2. Build & run.
3. Click the pop-up button.
4. Select one of the items in its menu.
5. Watch carefully!

(You may want to do the shift key slows animations trick, there’s an env var for that as I recall.)


Expected Results:
I expected the menu to animate closed and for the pop-up button itself never to show the layout of the menu item as shown in the menu.


Actual Results:
Instead, the menu animates closed leaving—for just a moment—the pop-up button showing the icon & title laid out approximately as they are in the menu. Then it jumps to the final (correct) button layout—small icon & text positioned correctly


Regression:
- Don’t recall this happening on Mavs but haven’t specifically tested.
- Doesn’t happen if you use a view to draw the menu items (but then you have to use a view to draw the menu items).
- Doesn’t make a difference whether you use Swift or Storyboards or neither, this is a reduction of an instance in an Objective-C/xib app.


Notes:
Sample project attached.

Note that the specific factors contributing to the different layout are:
- the size of the icon (32x32 or whatever, which is larger than what will be displayed by the menu item)
- the indentation level (1 for the selectable items)

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!