Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: ios/chrome/browser/ui/payments/address_edit_mediator.mm

Issue 2956433002: [Payment Request] keyboardType, autoCapitalizationType, etc for text fields (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/payments/address_edit_mediator.mm
diff --git a/ios/chrome/browser/ui/payments/address_edit_mediator.mm b/ios/chrome/browser/ui/payments/address_edit_mediator.mm
index 90128fc33b03f115842d77234a4bbf7a4fd4aa32..1dc7e724b3f71a0774dbe8a21b59b1f0804cf87e 100644
--- a/ios/chrome/browser/ui/payments/address_edit_mediator.mm
+++ b/ios/chrome/browser/ui/payments/address_edit_mediator.mm
@@ -260,6 +260,15 @@
label:nil
value:value
required:required];
+ // Set the keyboardType and autoCapitalizationType as appropriate.
+ if (autofillUIType == AutofillUITypeProfileEmailAddress) {
+ field.keyboardType = UIKeyboardTypeEmailAddress;
+ field.autoCapitalizationType = UITextAutocapitalizationTypeNone;
+ } else if (autofillUIType == AutofillUITypeProfileHomeAddressZip) {
+ field.autoCapitalizationType =
+ UITextAutocapitalizationTypeAllCharacters;
+ }
+
[self.fieldsMap setObject:field forKey:fieldKey];
}
@@ -321,6 +330,8 @@
label:l10n_util::GetNSString(IDS_IOS_AUTOFILL_PHONE)
value:value
required:YES];
+ field.keyboardType = UIKeyboardTypePhonePad;
+ field.returnKeyType = UIReturnKeyDone;
[self.fieldsMap setObject:field forKey:phoneNumberFieldKey];
}
[self.fields addObject:field];

Powered by Google App Engine
This is Rietveld 408576698