diff --git a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm index 5137976f7033c..75195368a7266 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm @@ -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; } diff --git a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.mm b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.mm index faee42df1b4c4..17ef8b2f2c7c4 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.mm @@ -307,6 +307,20 @@ - (void)testKeyboardType { 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* 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"];