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

Conversation

@htoor3
Copy link
Contributor

@htoor3 htoor3 commented Oct 13, 2023

The wrong keyboard type shows when users specify the phone input type in the framework.

This is happening because:

  • We usually set inputmode for mobile text editing strategies.
  • We only use Android's text editing strategy for Blink browser engines (not firefox), so we fall through to the Firefox text editing strategy which I believe should only be used for desktop firefox.
  • So we're ending up in a case where Android + Firefox doesn't set the inputmode and it pops open the default alphanumeric keyboard

Fixes flutter/flutter#136351

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides].
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or the PR is [test-exempt]. See [testing the engine] for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the [CLA].
  • All existing and new tests are passing.

@github-actions github-actions bot added the platform-web Code specifically for the web engine label Oct 13, 2023
} else if (browserEngine == BrowserEngine.webkit) {
strategy = SafariDesktopTextEditingStrategy(textEditing);
} else if (browserEngine == BrowserEngine.blink &&
} else if ((browserEngine == BrowserEngine.blink || browserEngine == BrowserEngine.firefox) &&
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there a contextual reason why we have to specify a browser engine as well as the OS when we're trying to select for a mobile text editing strategy? Or can we just always choose the android strategy when OS == android and always choose ios strategy when OS == iOS

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it makes sense to remove the browser engine check here and see what happens.

One thing to keep in mind is that on iOS, all browsers have to use the Webkit engine under the hood (because iOS doesn't allow apps to ship their own JIT, and all browsers need a JIT, so they have to use Webkit from iOS). On Android, this isn't the case.

@htoor3 htoor3 requested a review from mdebbar October 13, 2023 19:06
@flutter-dashboard
Copy link

This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold.

@htoor3 htoor3 force-pushed the fix-inputmode-firefox branch from 983e18e to 67b930b Compare February 6, 2024 17:26
Copy link
Contributor

@mdebbar mdebbar left a comment

Choose a reason for hiding this comment

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

LGTM!

@htoor3 htoor3 added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 8, 2024
@auto-submit auto-submit bot merged commit 6f5b6a3 into flutter:main Feb 8, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 8, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Feb 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App platform-web Code specifically for the web engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flutter web TextField with keyboardType=phone opens alpha-numeric keyboard on Android Firefox

2 participants