I am currently trying to get my app ready for full external keyboard support, while testing I found an issue with the native DatePicker.
Whenever I enter the DatePicker with an external keyboard it only jumps to the time picker and I am not able to move away from it. Arrow keys don't work, tab and control + tab only move me to the toolbar and back.
This is how they look like
private var datePicker: some View {
DatePicker(
"",
selection: date,
in: minDate...,
displayedComponents: [.date]
)
.fixedSize()
.accessibilityIdentifier("\(datePickerLabel).DatePicker")
}
private var timePicker: some View {
DatePicker(
"",
selection: date,
in: minDate...,
displayedComponents: [.hourAndMinute]
)
.fixedSize()
.accessibilityIdentifier("\(datePickerLabel).TimePicker")
}
private var datePickerLabelView: some View {
Text(datePickerLabel.localizedString)
.accessibilityIdentifier(datePickerLabel)
}
And we implement it like this in the view:
HStack {
datePickerLabelView
Spacer()
datePicker
timePicker
}
Does anyone know how to fix this behavior? Is it our fault or is it the system? The issue comes up both in iOS 18 and 26.
Topic:
Accessibility & Inclusion
SubTopic:
General
Tags:
External Accessory
iOS
Accessibility
SwiftUI