Disable autocorrection on profile name

This commit is contained in:
Davide De Rosa 2022-04-25 15:20:19 +02:00
parent deac70359f
commit 84790080be
3 changed files with 7 additions and 1 deletions

View File

@ -401,6 +401,11 @@ extension View {
// MARK: Validation
extension View {
func themeProfileName() -> some View {
autocapitalization(.none)
.disableAutocorrection(true)
}
func themeURL(_ urlString: String?) -> some View {
themeValidating(urlString, validator: Validators.url)
.keyboardType(.asciiCapable)

View File

@ -44,6 +44,7 @@ enum AddProfileView {
footer: themeErrorMessage(errorMessage)
) {
TextField(L10n.Global.Placeholders.profileName, text: $profileName, onCommit: onCommit)
.themeProfileName()
}
}
}

View File

@ -49,7 +49,7 @@ extension ProfileView {
header: Text(L10n.Profile.Alerts.Rename.title)
) {
TextField(L10n.Global.Placeholders.profileName, text: $newName, onCommit: commitRenaming)
.disableAutocorrection(true)
.themeProfileName()
.onAppear(perform: loadCurrentName)
}
}.themeSecondaryView()