@@ -159,39 +159,6 @@ struct CallingCodeField: View {
159159 private let maxCallingCodeLength = 4
160160
161161 var body : some View {
162- SwiftUI . TextField (
163- " authenticator.field.diallingCode.placeholder " . localized ( ) ,
164- text: $callingCode
165- )
166- . focused ( $isFocused)
167- . onChange ( of: callingCode) { text in
168- if text. isEmpty {
169- callingCode = " + "
170- } else if !text. hasPrefix ( " + " ) {
171- var updated = text
172- updated. removeAll ( where: { $0 == " + " } )
173- callingCode = " + \( updated) "
174- } else if text. count > maxCallingCodeLength {
175- callingCode = String ( text. prefix ( maxCallingCodeLength) )
176- }
177- }
178- . onChange ( of: isFocused) { isFocused in
179- if !isFocused, callingCode == " + " {
180- callingCode = defaultCallingCode
181- }
182- }
183- . multilineTextAlignment ( . center)
184- . accessibilityLabel ( Text (
185- " authenticator.field.diallingCode.label " . localized ( )
186- ) )
187- . textFieldStyle ( . plain)
188- . frame ( width: 55 )
189- #if os(iOS)
190- . keyboardType( . numberPad)
191- #endif
192- }
193-
194- private var callingCodePicker : some View {
195162 SwiftUI . Button (
196163 action: {
197164 isShowingList = true
@@ -211,6 +178,10 @@ struct CallingCodeField: View {
211178 allRegionsContent
212179 }
213180 }
181+ . accessibilityLabel ( Text (
182+ " authenticator.field.diallingCode.label " . localized ( )
183+ ) )
184+ . frame ( width: 55 )
214185 }
215186
216187 private var allRegionsContent : some View {
@@ -253,7 +224,8 @@ struct CallingCodeField: View {
253224 }
254225 )
255226 . buttonStyle ( . borderless)
256- . accessibilityLabel ( Text ( region. name) )
227+ . accessibilityLabel ( Text ( " \( region. name) , \( region. callingCode) " ) )
228+ . accessibilityRemoveTraits ( . isButton)
257229 }
258230 }
259231 . foregroundColor ( theme. colors. foreground. primary)
0 commit comments