Fix iOS Keyboard stuck as UIKeyboardTypeNamePhonePad (flutter/engine#20181)

P0 bug fix
This commit is contained in:
Justin McCandless
2020-07-31 11:57:48 -07:00
committed by GitHub
parent 869b36a616
commit 3ae4605206
2 changed files with 17 additions and 1 deletions

View File

@@ -461,7 +461,6 @@ static FlutterAutofillType autofillTypeOf(NSDictionary* configuration) {
self.secureTextEntry = [configuration[kSecureTextEntry] boolValue];
self.keyboardType = ToUIKeyboardType(inputType);
self.keyboardType = UIKeyboardTypeNamePhonePad;
self.returnKeyType = ToUIReturnKeyType(configuration[kInputAction]);
self.autocapitalizationType = ToUITextAutoCapitalizationType(configuration);

View File

@@ -145,6 +145,9 @@ FLUTTER_ASSERT_ARC
// Verify secureTextEntry is set to the correct value.
XCTAssertTrue(inputView.secureTextEntry);
// Verify keyboardType is set to the default value.
XCTAssertEqual(inputView.keyboardType, UIKeyboardTypeDefault);
// We should have only ever created one FlutterTextInputView.
XCTAssertEqual(inputFields.count, 1);
@@ -448,6 +451,20 @@ FLUTTER_ASSERT_ARC
XCTAssertNotEqual([inputView performSelector:@selector(font)], nil);
}
- (void)testKeyboardType {
NSDictionary* config = self.mutableTemplateCopy;
[config setValue:@{@"name" : @"TextInputType.url"} 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, UIKeyboardTypeURL);
}
- (void)testAutocorrectionPromptRectAppears {
FlutterTextInputView* inputView = [[FlutterTextInputView alloc] initWithFrame:CGRectZero];
inputView.textInputDelegate = engine;