SwiftUI custom focusable view cannot acquire focus programmatically on iPad with a hardware keyboard connected

On iPad, a SwiftUI view using .focusable(interactions: .edit) and .focused($isFocused) cannot acquire focus when a hardware keyboard is already connected. Setting isFocused = true from a button leaves it false. Tapping the view also leaves it unfocused, although the tap is received. Pressing Tab can focus the same view.

struct FocusProbeView: View {
    @FocusState private var isFocused: Bool

    var body: some View {
        VStack {
            Text("Target")
                .focusable(interactions: .edit)
                .focused($isFocused)
                .onTapGesture { print("Target tapped") }

            Text("isFocused = \(isFocused)")

            Button("Focus target") {
                isFocused = true
            }
        }
        .defaultFocus($isFocused, true)
    }
}

Steps to reproduce:

  1. Run this view on an iPad with a hardware keyboard connected.
  2. Tap “Focus target”, then tap “Target”.
  3. Observe that isFocused remains false.
  4. Press Tab. The target can receive focus through keyboard navigation.
  5. Disconnect the keyboard. Restart the app and tap “Focus target” again. isFocused becomes true. Reconnecting the keyboard does not remove that focus.

Expected: A visible custom view marked .focusable(interactions: .edit) can receive focus through @FocusState, including when a hardware keyboard is connected.

Actual: Programmatic focus fails when the keyboard is already connected. A native TextField tested with the same button and @FocusState does receive focus.

Environment:

  • iPad model: MU1V2NF/A; iPadOS version: 26.7.2; Xcode version: 27.2; hardware keyboard: Logi Folio Touch.
  • iPad model: Device Hub iPad Pro 11-inch (M5); iPadOS version: 27.2; Xcode version: 27.2; hardware keyboard: Device Hub.

This looks very similar to a known issue several folks reported. Do you have a feedback report yet? If not, I’d suggest that you file one so you can track the issue, update Apple Engineering with additional information, learn if the issue is already known, and get notified of problem resolution.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.