Skip to content

Commit 228281c

Browse files
committed
Only dismiss the keyboard when selecting the country or state
1 parent 959bfa0 commit 228281c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

WooCommerce/Classes/ViewRelated/Orders/Order Details/Address Edit/EditOrderAddressForm.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ struct EditOrderAddressForm<ViewModel: AddressFormViewModelProtocol>: View {
145145
Spacer(minLength: safeAreaInsets.bottom)
146146
}
147147
.disableAutocorrection(true)
148-
.scrollDismissesKeyboard(.immediately)
149148
.background(Color(.listBackground))
150149
.ignoresSafeArea(.container, edges: [.horizontal, .bottom])
151150
}
@@ -429,6 +428,12 @@ struct SingleAddressForm: View {
429428
.padding(.horizontal, insets: safeAreaInsets)
430429
.background(Color(.systemBackground))
431430
.addingTopAndBottomDividers()
431+
.onChange(of: showStateSelector) {
432+
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
433+
}
434+
.onChange(of: showCountrySelector) {
435+
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
436+
}
432437
}
433438
}
434439

0 commit comments

Comments
 (0)