Skip to content

Commit

Permalink
Merge pull request #521 from LiYanan2004/main
Browse files Browse the repository at this point in the history
Improve signing experience when using non-english keyboard
  • Loading branch information
MattKiazyk authored Mar 8, 2024
2 parents 238ac71 + 5054ead commit 5993385
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Xcodes/Frontend/SignIn/SignInCredentialsView.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import SwiftUI

struct SignInCredentialsView: View {
private enum FocusedField {
case username, password
}

@EnvironmentObject var appState: AppState
@State private var username: String = ""
@State private var password: String = ""
@FocusState private var focusedField: FocusedField?

var body: some View {
VStack(alignment: .leading) {
Expand All @@ -16,11 +21,13 @@ struct SignInCredentialsView: View {
TextField(text: $username) {
Text(verbatim: "example@icloud.com")
}
.focused($focusedField, equals: .username)
}
HStack {
Text("Password")
.frame(minWidth: 100, alignment: .trailing)
SecureField("Required", text: $password)
.focused($focusedField, equals: .password)
}
if appState.authError != nil {
HStack {
Expand Down

0 comments on commit 5993385

Please sign in to comment.