Fix iOS Keyboard stuck as UIKeyboardTypeNamePhonePad (flutter/engine#20181)
P0 bug fix
This commit is contained in:
committed by
GitHub
parent
869b36a616
commit
3ae4605206
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user