visiblePassword uses ASCII keyboard on iOS (flutter/engine#50293)
Fixes https://github.com/flutter/flutter/issues/129113 The documentation states that the `visiblePassword` input type > Requests a keyboard with ready access to both letters and numbers. `UIKeyboardTypeASCIICapable` seems to be the closest match. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
@@ -137,6 +137,9 @@ static UIKeyboardType ToUIKeyboardType(NSDictionary* type) {
|
||||
if ([inputType isEqualToString:@"TextInputType.url"]) {
|
||||
return UIKeyboardTypeURL;
|
||||
}
|
||||
if ([inputType isEqualToString:@"TextInputType.visiblePassword"]) {
|
||||
return UIKeyboardTypeASCIICapable;
|
||||
}
|
||||
return UIKeyboardTypeDefault;
|
||||
}
|
||||
|
||||
|
||||
@@ -307,6 +307,20 @@ FLUTTER_ASSERT_ARC
|
||||
XCTAssertEqual(inputView.keyboardType, UIKeyboardTypeURL);
|
||||
}
|
||||
|
||||
- (void)testVisiblePasswordUseAlphanumeric {
|
||||
NSDictionary* config = self.mutableTemplateCopy;
|
||||
[config setValue:@{@"name" : @"TextInputType.visiblePassword"} forKey:@"inputType"];
|
||||
[self setClientId:123 configuration:config];
|
||||
|
||||
// Find all the FlutterTextInputViews we created.
|
||||
NSArray<FlutterTextInputView*>* inputFields = self.installedInputViews;
|
||||
|
||||
FlutterTextInputView* inputView = inputFields[0];
|
||||
|
||||
// Verify keyboardType is set to the value specified in config.
|
||||
XCTAssertEqual(inputView.keyboardType, UIKeyboardTypeASCIICapable);
|
||||
}
|
||||
|
||||
- (void)testSettingKeyboardTypeNoneDisablesSystemKeyboard {
|
||||
NSDictionary* config = self.mutableTemplateCopy;
|
||||
[config setValue:@{@"name" : @"TextInputType.none"} forKey:@"inputType"];
|
||||
|
||||
Reference in New Issue
Block a user