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

Conversation

@LongCatIsLooong
Copy link
Contributor

Fixes flutter/flutter#41508

UIKeyboardTypeNamePhonePad seems to be required in order to trigger name/address autofill.

Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I'm glad we're supporting more keyboard types.

Copy link
Contributor

@darrenaustin darrenaustin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. This all LGTM, but I will let someone who is more familiar with the engine to approve it.

static UIKeyboardType ToUIKeyboardType(NSDictionary* type) {
NSString* inputType = type[@"name"];
if ([inputType isEqualToString:@"TextInputType.text"])
if ([inputType isEqualToString:@"TextInputType.address"])
Copy link
Contributor Author

@LongCatIsLooong LongCatIsLooong May 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This type of keyboard does not trigger address autofill (tested on iOS 13.5). Developers would have to use TextInputType.name instead to trigger address autofill, that seems really counterintuitive. But the TextInputType.name (UIKeyboardTypeNamePhonePad) keyboard doesn't have punctuation so it's not perfect for entering addresses.

Instead of returning UIKeyboardTypeNamePhonePad here, I feel it's better to document the behavior in the framework so developers know what keyboard type to use, if they value address autofill more than having punctuations on the keyboard.

@LongCatIsLooong LongCatIsLooong merged commit 8b49873 into flutter:master May 12, 2020
@LongCatIsLooong LongCatIsLooong deleted the more-keyboard-types branch May 12, 2020 02:41
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 12, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 13, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 13, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 13, 2020
iskakaushik pushed a commit to flutter/flutter that referenced this pull request May 13, 2020
* db82bfb Roll src/third_party/skia c74db7998b4e..518fd4d9d09d (1 commits) (flutter/engine#18278)

* 4a1f9fa refactor the task_runner and task_runner_checker (flutter/engine#18238)

* ccfec72 Fix grammar in FlBinaryCodec/FlStringCodec descriptions (flutter/engine#18268)

* 044f254 Use the term 'handler' for registering callbacks. (flutter/engine#18269)

* 8d76518 Fix latest_frame_target_time race (flutter/engine#18279)

* 72a48bd Fix incorrect declaration of FlBinaryCodec (flutter/engine#18283)

* cb6b620 Roll src/third_party/skia 518fd4d9d09d..dd1de25896e9 (2 commits) (flutter/engine#18282)

* b1622c2 Roll src/third_party/dart 4e520824f502..2497606fed87 (11 commits) (flutter/engine#18284)

* 2f6bcde Add FlStandardMessageCodec (flutter/engine#18213)

* 4aa928d Roll src/fuchsia/sdk/mac from Hss3M... to gOhJW... (flutter/engine#18286)

* a549e96 Roll src/fuchsia/sdk/linux from oDp5y... to TZN85... (flutter/engine#18287)

* 8b49873 add new keyboard types and missing autofill hints (flutter/engine#18202)

* 86462ee Roll src/third_party/dart 2497606fed87..c6db98667aa6 (4 commits) (flutter/engine#18289)

* 624480f Roll src/third_party/skia dd1de25896e9..36bda05b2199 (1 commits) (flutter/engine#18291)

* ea0a764 Roll src/third_party/skia 36bda05b2199..4e9cfe7691dd (4 commits) (flutter/engine#18292)

* 7cf426e Roll src/third_party/dart c6db98667aa6..245a574301b1 (3 commits) (flutter/engine#18294)

* 8d379e9 Roll src/third_party/skia 4e9cfe7691dd..3d2c41b773f6 (1 commits) (flutter/engine#18296)

* f4220c2 Roll src/third_party/dart 245a574301b1..d5650235a249 (7 commits) (flutter/engine#18297)

* 7eb6ffe [fuchsia] Disable failing physical shape layer tests (flutter/engine#18308)

* 6689481 Temporarily disabling the fuchsia shell, runtime tests (flutter/engine#18319)

* a6baef1 Disable flow tests on Fuchsia (flutter/engine#18323)

* f6d3e7f Disable all fuchsia tests temporarily (flutter/engine#18326)

* b59e3e9 Roll src/third_party/dart d5650235a249..2bf325900586 (35 commits) (flutter/engine#18327)
@xster
Copy link
Member

xster commented May 20, 2020

(combing through recent untested PRs)
could this be tested?

@LongCatIsLooong
Copy link
Contributor Author

@xster I think I can write a test for the iOS part. I don't know how this can be tested on android because I can't find a way to send an arbitrary message to a TextInputChannel. Had the same problem in #17857.

@xster
Copy link
Member

xster commented May 20, 2020

The MethodChannel takes a BinaryMessenger right. It should be mostly straightforward to give it a mock BinaryMessenger. Capture the argument instance when setMethodCallHandler is called on the mock and then invoke things on that MethodCallHandler instance directly. You don't even need access to the MethodCallHandler subclass implementation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Have TextInputType.datetime use UIKeyboardType.numbersAndPunctuation on iOS

5 participants