Skip to content

Commit 5054ead

Browse files
committed
Improve signing experience when using non-english keyboard
1 parent 91f7584 commit 5054ead

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Xcodes/Frontend/SignIn/SignInCredentialsView.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import SwiftUI
22

33
struct SignInCredentialsView: View {
4+
private enum FocusedField {
5+
case username, password
6+
}
7+
48
@EnvironmentObject var appState: AppState
59
@State private var username: String = ""
610
@State private var password: String = ""
11+
@FocusState private var focusedField: FocusedField?
712

813
var body: some View {
914
VStack(alignment: .leading) {
@@ -16,11 +21,13 @@ struct SignInCredentialsView: View {
1621
TextField(text: $username) {
1722
Text(verbatim: "example@icloud.com")
1823
}
24+
.focused($focusedField, equals: .username)
1925
}
2026
HStack {
2127
Text("Password")
2228
.frame(minWidth: 100, alignment: .trailing)
2329
SecureField("Required", text: $password)
30+
.focused($focusedField, equals: .password)
2431
}
2532
if appState.authError != nil {
2633
HStack {

0 commit comments

Comments
 (0)