Can't switch focus between two input fields when voiceover is on (SwiftUI)

I have the following simple demo view:

struct DummyTestView: View {
    @State private var inputValue1 = ""
    @State private var inputValue2 = ""

    var body: some View {
        VStack {
            Group {
                TextField("input field1", text: $inputValue1)
                Text("value1: \(inputValue1)")
            }
            .padding( .all)
            .overlay(RoundedRectangle(cornerRadius: 6)
                        .stroke(Color.black.opacity(0.5), lineWidth: 2)
            )
            .padding( .all)
            
            Group {
                TextField("input field2", text: $inputValue2)
                Text("value2: \(inputValue2)")
            }
            .padding(.all)
            .overlay(RoundedRectangle(cornerRadius: 6)
                        .stroke(Color.black.opacity(0.5), lineWidth: 2)
            )
            .padding(.all)
       }
    }
}

When I typed something in first input field, then switch to another input field and type something there - I'am not able to switch back to the first input field and edit it. All this could be reproduced only when voice over is on.

The issue not reproduced when:

  • replace "VStack" with "Form";
  • remove any dependency for "inputValue" between "TextField" and "Text".

Environment: iOS 14.1, iPhone 12 mini, with enabled voice over. Any suggestions to update iOS to the latest version is not acceptable because our application should support iOS 14 and above.

Hello,

Could you please further outline your steps? What do you mean by "I'm not able to switch back to the first input field".

Are you stating that, even after dismissing the keyboard and then swipe left VoiceOver is not moving to the first input field? In addition, while the keyboard is visible you should be able to tap once on the first text field, and then double tap to begin editing it. Both of these ways should work to move VoiceOver focus to the first text field.

Cheers, Nathan | Accessibility Team

No nothing has work. When I tap once on the first text field I hear: "is editing, character mode" instead of "text field, double tap to edit". And then I try to double tap to begin edit this focused field and I hear following: "insertion point at start". Another simple way to reproduce this issue: leave only single text field with associated "Text" as following:

struct DummyTestView: View {
    @State private var inputValue1 = ""
 
    var body: some View {
        VStack {
            Group {
                TextField("input field1", text: $inputValue1)
                Text("value1: \(inputValue1)")
            }
            .padding( .all)
            .overlay(RoundedRectangle(cornerRadius: 6)
                        .stroke(Color.black.opacity(0.5), lineWidth: 2)
            )
            .padding( .all)
       }
    }
}

Once you try to edit this text field and hit "Return" button, you not able to edit this text field anymore. Please take a look at following screen recording:

https://drive.google.com/file/d/17ySCwEUlH8IcFhqmiSF-WBSl_GTJEX_1 https://drive.google.com/file/d/1G4v21F9xlQue1yvEbcqxv55ysUTtTmqB

Or simply try to reproduce this issue with proposed code.

Hello,

This is a bug in the system thats been fixed in iOS 15.

Thanks,

Nathan | Accessibility

Can't switch focus between two input fields when voiceover is on (SwiftUI)
 
 
Q