File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ struct TogglableSecureInput: View {
1010 let placeholder : String
1111 @Binding var text : String
1212 let style : Style
13+ var textContentType : UITextContentType ? = nil
1314
1415 @State private var isVisible = false
1516 @FocusState private var isFocused : Bool
@@ -20,9 +21,13 @@ struct TogglableSecureInput: View {
2021 switch style {
2122 case . singleLine:
2223 if isVisible {
23- TextField ( placeholder, text: $text) . multilineTextAlignment ( . trailing)
24+ TextField ( placeholder, text: $text)
25+ . multilineTextAlignment ( . trailing)
26+ . textContentType ( textContentType)
2427 } else {
25- SecureField ( placeholder, text: $text) . multilineTextAlignment ( . trailing)
28+ SecureField ( placeholder, text: $text)
29+ . multilineTextAlignment ( . trailing)
30+ . textContentType ( textContentType)
2631 }
2732
2833 case . multiLine:
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ struct NightscoutSettingsView: View {
2727 private var urlSection : some View {
2828 Section ( header: Text ( " URL " ) ) {
2929 TextField ( " Enter URL " , text: $viewModel. nightscoutURL)
30- . textContentType ( . URL )
30+ . textContentType ( . username )
3131 . autocapitalization ( . none)
3232 . disableAutocorrection ( true )
3333 . onChange ( of: viewModel. nightscoutURL) { newValue in
@@ -43,7 +43,8 @@ struct NightscoutSettingsView: View {
4343 TogglableSecureInput (
4444 placeholder: " Enter Token " ,
4545 text: $viewModel. nightscoutToken,
46- style: . singleLine
46+ style: . singleLine,
47+ textContentType: . password
4748 )
4849 }
4950 }
You can’t perform that action at this time.
0 commit comments