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 // MARK: Validation
extension View { extension View {
func themeProfileName() -> some View {
autocapitalization(.none)
.disableAutocorrection(true)
}
func themeURL(_ urlString: String?) -> some View { func themeURL(_ urlString: String?) -> some View {
themeValidating(urlString, validator: Validators.url) themeValidating(urlString, validator: Validators.url)
.keyboardType(.asciiCapable) .keyboardType(.asciiCapable)

View File

@ -44,6 +44,7 @@ enum AddProfileView {
footer: themeErrorMessage(errorMessage) footer: themeErrorMessage(errorMessage)
) { ) {
TextField(L10n.Global.Placeholders.profileName, text: $profileName, onCommit: onCommit) 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) header: Text(L10n.Profile.Alerts.Rename.title)
) { ) {
TextField(L10n.Global.Placeholders.profileName, text: $newName, onCommit: commitRenaming) TextField(L10n.Global.Placeholders.profileName, text: $newName, onCommit: commitRenaming)
.disableAutocorrection(true) .themeProfileName()
.onAppear(perform: loadCurrentName) .onAppear(perform: loadCurrentName)
} }
}.themeSecondaryView() }.themeSecondaryView()