reports
reports copied to clipboard
FB20925696: initialFirstResponder broken with modal sessions and DispatchQueue.main
Submission Date
2025-11-05
Status
Open
Area
AppKit
Operating System Version
macOS 26.1
Type
Incorrect/Unexpected Behavior
Description
Controls (ie. text fields) added to NSAlerts via NSAlert.accessoryView no longer receive focus when the alert is shown and the text field is configured to automatically receive focus via alert.window.initialFirstResponder.
The issue only reproduces under certain circumstances. There seem to be two conditions that are required for the issue to occur:
- The alert must be shown in a modal manner. Either through
NSAlert.runModalor a custom modal session viaNSApplication.beginModalSessionand friends. - The code running the modal session must be invoked through the Main Dispatch Queue (ie.
DispatchQueue.main).
When the alert is instead shown through a performSelectorOnMainThread or a regular function call everything's working as expected.
Demo project is available here.
Keywords
No response
Prerequisites
- [x] The title follows the format
FB<number>: <title> - [x] I will keep this issue updated with Apple's responses