This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree 4 files changed +21
-2
lines changed
embedding/engine/systemchannels
darwin/ios/framework/Source 4 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -717,7 +717,8 @@ public enum TextInputType {
717
717
EMAIL_ADDRESS ("TextInputType.emailAddress" ),
718
718
URL ("TextInputType.url" ),
719
719
VISIBLE_PASSWORD ("TextInputType.visiblePassword" ),
720
- NONE ("TextInputType.none" );
720
+ NONE ("TextInputType.none" ),
721
+ WEB_SEARCH ("TextInputType.webSearch" );
721
722
722
723
static TextInputType fromValue (@ NonNull String encodedName ) throws NoSuchFieldException {
723
724
for (TextInputType textInputType : TextInputType .values ()) {
Original file line number Diff line number Diff line change @@ -252,7 +252,8 @@ private static int inputTypeFromTextInputType(
252
252
textType |= InputType .TYPE_TEXT_FLAG_MULTI_LINE ;
253
253
} else if (type .type == TextInputChannel .TextInputType .EMAIL_ADDRESS ) {
254
254
textType |= InputType .TYPE_TEXT_VARIATION_EMAIL_ADDRESS ;
255
- } else if (type .type == TextInputChannel .TextInputType .URL ) {
255
+ } else if (type .type == TextInputChannel .TextInputType .URL
256
+ || type .type == TextInputChannel .TextInputType .WEB_SEARCH ) {
256
257
textType |= InputType .TYPE_TEXT_VARIATION_URI ;
257
258
} else if (type .type == TextInputChannel .TextInputType .VISIBLE_PASSWORD ) {
258
259
textType |= InputType .TYPE_TEXT_VARIATION_VISIBLE_PASSWORD ;
Original file line number Diff line number Diff line change @@ -140,6 +140,9 @@ static UIKeyboardType ToUIKeyboardType(NSDictionary* type) {
140
140
if ([inputType isEqualToString: @" TextInputType.visiblePassword" ]) {
141
141
return UIKeyboardTypeASCIICapable;
142
142
}
143
+ if ([inputType isEqualToString: @" TextInputType.webSearch" ]) {
144
+ return UIKeyboardTypeWebSearch;
145
+ }
143
146
return UIKeyboardTypeDefault;
144
147
}
145
148
Original file line number Diff line number Diff line change @@ -307,6 +307,20 @@ - (void)testKeyboardType {
307
307
XCTAssertEqual(inputView.keyboardType, UIKeyboardTypeURL);
308
308
}
309
309
310
+ - (void)testKeyboardTypeWebSearch {
311
+ NSDictionary* config = self.mutableTemplateCopy;
312
+ [config setValue:@{@"name" : @"TextInputType.webSearch"} forKey:@"inputType"];
313
+ [self setClientId:123 configuration:config];
314
+
315
+ // Find all the FlutterTextInputViews we created.
316
+ NSArray<FlutterTextInputView*>* inputFields = self.installedInputViews;
317
+
318
+ FlutterTextInputView* inputView = inputFields[0];
319
+
320
+ // Verify keyboardType is set to the value specified in config.
321
+ XCTAssertEqual(inputView.keyboardType, UIKeyboardTypeWebSearch);
322
+ }
323
+
310
324
- (void)testVisiblePasswordUseAlphanumeric {
311
325
NSDictionary* config = self.mutableTemplateCopy;
312
326
[config setValue:@{@"name" : @"TextInputType.visiblePassword"} forKey:@"inputType"];
You can’t perform that action at this time.
0 commit comments