Explorar o código

VLCNetworkLoginDataSourceLogin: Set to lowercase by default in the username field

(closes #424)
Mitch Cohen %!s(int64=6) %!d(string=hai) anos
pai
achega
5a6842b79a

+ 3 - 0
Sources/LocalNetworkConnectivity/VLCNetworkLoginDataSourceLogin.m

@@ -65,6 +65,7 @@ typedef NS_ENUM(NSUInteger, VLCNetworkServerLoginIndex) {
     NSString *labelString = nil;
     NSString *valueString = nil;
     UIReturnKeyType returnKeyType = UIReturnKeyNext;
+    UITextAutocapitalizationType autocapitalizationType = UITextAutocapitalizationTypeSentences;
     switch (row) {
         case VLCNetworkServerLoginIndexServer:
             keyboardType = UIKeyboardTypeURL;
@@ -78,6 +79,7 @@ typedef NS_ENUM(NSUInteger, VLCNetworkServerLoginIndex) {
             break;
         case VLCNetworkServerLoginIndexUsername:
             labelString = NSLocalizedString(@"USER_LABEL", nil);
+            autocapitalizationType = UITextAutocapitalizationTypeNone;
             valueString = self.loginInformation.username;
             break;
         case VLCNetworkServerLoginIndexPassword:
@@ -104,6 +106,7 @@ typedef NS_ENUM(NSUInteger, VLCNetworkServerLoginIndex) {
 
     fieldCell.placeholderString = labelString;
     UITextField *textField = fieldCell.textField;
+    textField.autocapitalizationType = autocapitalizationType;
     textField.text              = valueString;
     textField.keyboardType      = keyboardType;
     textField.secureTextEntry   = secureTextEntry;