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

[web] Ignore keydown event for tab during IME composition #37753

Merged
merged 9 commits into from
Nov 28, 2022

Conversation

htoor3
Copy link
Contributor

@htoor3 htoor3 commented Nov 18, 2022

During IME composition, Tab gets fired twice: once as part of the composition of the character and once without. This leads to unexpected behavior such as skipping a textfield during tab and input mutation. The solution is to ignore the keydown event that's a part of composition.

Fixes flutter/flutter#74813

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 Hixie said 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.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added the platform-web Code specifically for the web engine label Nov 18, 2022
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@htoor3 htoor3 requested a review from mdebbar November 22, 2022 17:48
@htoor3 htoor3 changed the title Stop propagation to prevent additional tab keydown during composition Ignore keydown event for tab during IME composition Nov 22, 2022
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.

Thanks @htoor3 for fixing this issue!

cc @dkwingsmt in case we need to do something similar for the hardware keyboard.

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 merged commit a41c6ec into flutter:main Nov 28, 2022
@htoor3 htoor3 added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 28, 2022
@htoor3 htoor3 changed the title Ignore keydown event for tab during IME composition [web] Ignore keydown event for tab during IME composition Nov 28, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 28, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 28, 2022
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Nov 28, 2022
…116140)

* a41c6ece2 Ignore keydown event for tab during IME composition (flutter/engine#37753)

* f326b630d Roll Skia from 6f65f0631e5a to 4a4cfedd1c20 (6 revisions) (flutter/engine#37942)
mit-mit pushed a commit to mit-mit/flutter that referenced this pull request Dec 6, 2022
…lutter#116140)

* a41c6ece2 Ignore keydown event for tab during IME composition (flutter/engine#37753)

* f326b630d Roll Skia from 6f65f0631e5a to 4a4cfedd1c20 (6 revisions) (flutter/engine#37942)
shogohida pushed a commit to shogohida/flutter that referenced this pull request Dec 7, 2022
…lutter#116140)

* a41c6ece2 Ignore keydown event for tab during IME composition (flutter/engine#37753)

* f326b630d Roll Skia from 6f65f0631e5a to 4a4cfedd1c20 (6 revisions) (flutter/engine#37942)
gspencergoog pushed a commit to gspencergoog/flutter that referenced this pull request Jan 19, 2023
…lutter#116140)

* a41c6ece2 Ignore keydown event for tab during IME composition (flutter/engine#37753)

* f326b630d Roll Skia from 6f65f0631e5a to 4a4cfedd1c20 (6 revisions) (flutter/engine#37942)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects: text input autosubmit Merge PR when tree becomes green via auto submit App needs tests platform-web Code specifically for the web engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Flutter Web] Pressing Tab key at the end Korean input, copies last character to next TextField
3 participants