Skip to content

Commit

Permalink
Fix iOS Keyboard stuck as UIKeyboardTypeNamePhonePad (flutter#20181)
Browse files Browse the repository at this point in the history
P0 bug fix
  • Loading branch information
justinmc authored Jul 31, 2020
1 parent ed36b1a commit fcc1eaf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ - (void)configureWithDictionary:(NSDictionary*)configuration {

self.secureTextEntry = [configuration[kSecureTextEntry] boolValue];
self.keyboardType = ToUIKeyboardType(inputType);
self.keyboardType = UIKeyboardTypeNamePhonePad;
self.returnKeyType = ToUIReturnKeyType(configuration[kInputAction]);
self.autocapitalizationType = ToUITextAutoCapitalizationType(configuration);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ - (void)testSecureInput {
// 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);

Expand Down Expand Up @@ -448,6 +451,20 @@ - (void)testPasswordAutofillHack {
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;
Expand Down

0 comments on commit fcc1eaf

Please sign in to comment.