Description
On iOS 26.1, a ToolbarItem placed in .keyboard is no longer exposed to the accessibility hierarchy. As a result:
- VoiceOver cannot focus or activate the toolbar button
- XCUITest cannot discover the element, making the UI impossible to test
TextEditor()
.toolbar {
ToolbarItem(placement: .keyboard) {
Button("Done") { /* action */ }
}
}
This worked correctly on previous iOS versions.
The button appears visually but is missing from both VoiceOver navigation and XCUI accessibility queries.
Steps to Reproduce
- Create a new SwiftUI project.
- Use a simple text field with a keyboard toolbar button.
- Run on an iOS 26.1 device or simulator.
- Focus the text field to show the keyboard.
- Turn on VoiceOver and attempt to navigate to the toolbar button.
- Run an XCUITest attempting to locate the button