When I run the code below and enable VoiceOver on my iPhone running iOS 16.6, it navigates from "email1" to "email2".
When I run it on an iPhone simulator running iOS 16.4 and use the A11y Inspector it navigates from "email1" to the first textField, and then to "email2"
when I delete the .accessibilityRepresentation it navigates from "email1" to the first textField, and the to "email2" on both simulator and device.
Am I using .accessibilityRepresentation incorrectly? Or did something change between 16.4 and 16.6? Or is there a better question I should be asking?
any and all help greatly appreciated
struct ContentView: View {
@State var input1: String = ""
@State var input2: String = ""
var body: some View {
VStack {
TextInput(title: "email1", inputText: $input1)
TextInput(title: "email2", inputText: $input2)
}
}
}
struct TextInput: View {
let title: String
@Binding var inputText: String
init(title: String, inputText: Binding<String>) {
self.title = title
self._inputText = inputText
}
var body: some View {
VStack {
Text(title)
TextField("enter Text", text: $inputText)
.accessibilityRepresentation {
TextField("enter Text", text: $inputText)
}
}
}
}