@@ -10,7 +10,6 @@ struct LoginForm<S: Session>: View {
1010 @State private var loginError : LoginError ?
1111 @State private var currentPage : LoginPage = . serverURL
1212 @State private var loading : Bool = false
13- @FocusState private var focusedField : LoginField ?
1413
1514 let inspection = Inspection < Self > ( )
1615
@@ -20,19 +19,9 @@ struct LoginForm<S: Session>: View {
2019 case . serverURL:
2120 serverURLPage
2221 . transition ( . move( edge: . leading) )
23- . onAppear {
24- DispatchQueue . main. async {
25- focusedField = . baseAccessURL
26- }
27- }
2822 case . sessionToken:
2923 sessionTokenPage
3024 . transition ( . move( edge: . trailing) )
31- . onAppear {
32- DispatchQueue . main. async {
33- focusedField = . sessionToken
34- }
35- }
3625 }
3726 }
3827 . animation ( . easeInOut, value: currentPage)
@@ -90,9 +79,8 @@ struct LoginForm<S: Session>: View {
9079 text: $baseAccessURL,
9180 prompt: Text ( " https://coder.example.com " )
9281 ) . autocorrectionDisabled ( )
93- . focused ( $focusedField, equals: . baseAccessURL)
9482 }
95- } . formStyle ( . grouped) . scrollDisabled ( true ) . padding ( )
83+ } . formStyle ( . grouped) . scrollDisabled ( true ) . padding ( . horizontal )
9684 Divider ( )
9785 HStack {
9886 Spacer ( )
@@ -122,7 +110,6 @@ struct LoginForm<S: Session>: View {
122110 SecureField ( " Session Token " , text: $sessionToken, prompt: Text ( " ●●●●●●●● " ) )
123111 . autocorrectionDisabled ( )
124112 . privacySensitive ( )
125- . focused ( $focusedField, equals: . sessionToken)
126113 HStack ( spacing: 0 ) {
127114 Text ( " Generate a session token at " )
128115 . font ( . subheadline)
@@ -132,7 +119,7 @@ struct LoginForm<S: Session>: View {
132119 . foregroundColor ( . blue)
133120 }
134121 }
135- } . formStyle ( . grouped) . scrollDisabled ( true ) . padding ( )
122+ } . formStyle ( . grouped) . scrollDisabled ( true ) . padding ( . horizontal )
136123 Divider ( )
137124 HStack {
138125 Spacer ( )
@@ -157,14 +144,12 @@ struct LoginForm<S: Session>: View {
157144 }
158145 withAnimation {
159146 currentPage = . sessionToken
160- focusedField = . sessionToken
161147 }
162148 }
163149
164150 private func back( ) {
165151 withAnimation {
166152 currentPage = . serverURL
167- focusedField = . baseAccessURL
168153 }
169154 }
170155}
0 commit comments