Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Fix iOS Keyboard stuck as UIKeyboardTypeNamePhonePad #20181

Merged
merged 3 commits into from
Jul 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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