With Xcode 14, my app's popup menus don't stay open

I have a segmented control in my app's toolbar with menus assigned to each segment, so that clicking the segment triggers a command, but click and hold opens the menu. This is using standard NSSegmentedControl behavior.

After building with Xcode 14, however, I find that the behavior is changed: click and hold still opens the menu, but the menu closes as soon as you release the button. The menu used to stay open until you select an item or click outside to dismiss it.

This is a problem because my automated tests rely on the menu staying open if you click and hold without moving the mouse. I'm having trouble finding a workaround.

I tried changing my click(forDuration:) call to click(forDuration:thenDragTo:) so that it selects the menu item before releasing the button, but that doesn't work because it tries to resolve the menu item's XCUIElement before executing the click, so it fails because the menu isn't open yet. (I filed feedback for this problematic behavior - FB11513016)

Is there another workaround I can try? Or a way to restore the popup menu "sticky" behavior?