NSPopover unexpectedly dismisses when clicking on views in macOS 13.6
I'm sure I'm missing something obvious here, but I'm experimenting with I'm maintaining legacy code that I'm implementing an NSPopover in my macOS app, and I'm working with an scenario where the popover dismisses unexpectedly when I click on certain views within the popover itself... The popover is created as follows: ```swift let popover = NSPopover() popover.contentSize = NSSize(width: 300, height: 200) popover.contentViewController = MyPopoverViewController() popover.behavior = .transient ``` In my view controller, I've set up a button to perform an action: ```swift @IBAction func performAction(_ sender: NSButton) { print("Action performed!") } ``` The scenario arises when I try to click the button within the popover. Instead of remaining open, the popover dismisses immediately. I've ensured that the popover is displayed correctly and that the views are interactive. It only dismisses when I interact with certain elements like buttons or text fields, while it remains open if I click on empty areas. I've tried changing the popover's behavior to `.semitransient`, but that didn't resolve the scenario. Additionally, I checked for any conflicting gesture recognizers or event handlers but found nothing unusual. The popover has no special attributes that would cause it to dismiss, and I've also checked the console for any warnings or errors, but there are none. Here's how I'm presenting the popover: ```swift popover.show(relativeTo: sender.bounds, of: sender, preferredEdge: .minY) ``` I suspect this might be related to the focus behavior in macOS 13.6, but I need to pinpoint the exact cause. Has anyone else encountered this question, and if so, how did you resolve it? Any insights or suggestions on how to prevent the popover from dismissing when interacting with its own views would be greatly appreciated. Is this even possible? This issue appeared after updating to Swift LTS. Is there a simpler solution I'm overlooking? This issue appeared after updating to Swift LTS. How would you solve this?