Post

Replies

Boosts

Views

Activity

Reply to iOS17 - Setting FocusState to false via Button is not working
Does this solve the issue? It works on my app. import SwiftUI struct FieldView: View { enum Field: Hashable { case amountField case descriptionField case categoryField } @FocusState private var focusedField: Field? @State var description = "" var body: some View { TextField("Description" ,text: $description) .focused($focusedField, equals: .descriptionField) .keyboardType(.default) .onAppear() { focusedField = .descriptionField } .onSubmit { focusedField = .categoryField } .submitLabel(.next) } } }
Sep ’23