call focused field as first modifier

This commit is contained in:
Satindar Dhillon 2022-08-02 19:43:47 -07:00
parent 38fcbeb9a1
commit a0c7d4e3b5

View file

@ -95,11 +95,11 @@ struct EmailSignupFormView: View {
.font(.appFootnote)
.foregroundColor(.appGrayText)
TextField("", text: $email)
.focused($focusedField, equals: .email)
.textContentType(.emailAddress)
.keyboardType(.emailAddress)
.textInputAutocapitalization(.never)
.disableAutocorrection(true)
.focused($focusedField, equals: .email)
.submitLabel(.next)
}
.padding(.bottom, 8)
@ -110,10 +110,10 @@ struct EmailSignupFormView: View {
.font(.appFootnote)
.foregroundColor(.appGrayText)
SecureField("", text: $password)
.focused($focusedField, equals: .password)
.textContentType(.newPassword)
.textInputAutocapitalization(.never)
.disableAutocorrection(true)
.focused($focusedField, equals: .password)
.submitLabel(.next)
}
.padding(.bottom, 8)
@ -124,10 +124,10 @@ struct EmailSignupFormView: View {
.font(.appFootnote)
.foregroundColor(.appGrayText)
TextField("", text: $name)
.focused($focusedField, equals: .fullName)
.textContentType(.name)
.keyboardType(.alphabet)
.disableAutocorrection(true)
.focused($focusedField, equals: .fullName)
.submitLabel(.next)
}
.padding(.bottom, 8)
@ -140,11 +140,11 @@ struct EmailSignupFormView: View {
.font(.appFootnote)
.foregroundColor(.appGrayText)
TextField("", text: $viewModel.potentialUsername)
.focused($focusedField, equals: .username)
.textInputAutocapitalization(.never)
.textContentType(.username)
.disableAutocorrection(true)
.keyboardType(.alphabet)
.focused($focusedField, equals: .username)
.submitLabel(.done)
}