From cfb26c909b10c2c1e1a0fd63552b9db6b4ab3f19 Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Sun, 18 Dec 2022 19:20:52 +0800 Subject: [PATCH] Add .textContentType to enable autofill --- iOS/Account/Views/FeedbinAddAccountView.swift | 2 ++ .../Views/NewsBlurAddAccountView.swift | 2 ++ .../Views/ReaderAPIAddAccountView.swift | 19 ++++++++++--------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/iOS/Account/Views/FeedbinAddAccountView.swift b/iOS/Account/Views/FeedbinAddAccountView.swift index 678ab8c27..d24230f98 100644 --- a/iOS/Account/Views/FeedbinAddAccountView.swift +++ b/iOS/Account/Views/FeedbinAddAccountView.swift @@ -65,7 +65,9 @@ struct FeedbinAddAccountView: View { TextField("Email", text: $accountEmail, prompt: Text("ACCOUNT_EMAIL_ADDRESS_PROMPT", tableName: "Account")) .autocorrectionDisabled() .autocapitalization(.none) + .textContentType(.username) SecureField("Password", text: $accountPassword, prompt: Text("ACCOUNT_PASSWORD_PROMPT", tableName: "Account")) + .textContentType(.password) } } diff --git a/iOS/Account/Views/NewsBlurAddAccountView.swift b/iOS/Account/Views/NewsBlurAddAccountView.swift index 1f30dda17..ce84df509 100644 --- a/iOS/Account/Views/NewsBlurAddAccountView.swift +++ b/iOS/Account/Views/NewsBlurAddAccountView.swift @@ -82,7 +82,9 @@ struct NewsBlurAddAccountView: View, Logging { TextField("Email", text: $accountUserName, prompt: Text("ACCOUNT_USERNAME_OR_EMAIL_PROMPT", tableName: "Account")) .autocorrectionDisabled() .autocapitalization(.none) + .textContentType(.username) SecureField("Password", text: $accountPassword, prompt: Text("ACCOUNT_PASSWORD_PROMPT", tableName: "Account")) + .textContentType(.password) } } diff --git a/iOS/Account/Views/ReaderAPIAddAccountView.swift b/iOS/Account/Views/ReaderAPIAddAccountView.swift index 6f6d6e0d7..6be436511 100644 --- a/iOS/Account/Views/ReaderAPIAddAccountView.swift +++ b/iOS/Account/Views/ReaderAPIAddAccountView.swift @@ -33,6 +33,7 @@ struct ReaderAPIAddAccountView: View { AccountSectionHeader(accountType: accountType!) } accountDetails + accountButton Section(footer: readerAccountExplainer) {} } .navigationTitle(Text(accountType?.localizedAccountName() ?? "")) @@ -83,17 +84,17 @@ struct ReaderAPIAddAccountView: View { var accountDetails: some View { - Group { - Section { - TextField("Username", text: $accountUserName) + Section { + TextField("Username", text: $accountUserName) + .autocorrectionDisabled() + .autocapitalization(.none) + .textContentType(.username) + SecureField("Password", text: $accountSecret) + .textContentType(.password) + if accountType == .freshRSS && accountCredentials == nil { + TextField("FreshRSS URL", text: $accountAPIUrl, prompt: Text("fresh.rss.net/api/greader.php")) .autocorrectionDisabled() .autocapitalization(.none) - SecureField("Password", text: $accountSecret) - if accountType == .freshRSS && accountCredentials == nil { - TextField("FreshRSS URL", text: $accountAPIUrl, prompt: Text("fresh.rss.net/api/greader.php")) - .autocorrectionDisabled() - .autocapitalization(.none) - } } } }