Skip to content

Conversation

@sean-perkins
Copy link
Contributor

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Build (npm run build) was run locally and any changes were pushed
  • Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

IMEs (input method editors) intercept keyboard events and conflict with the patch in #24606, since both are assigning a value to the native input, resulting in duplicate values on keypress. This also breaks the back button behavior (observed in Japanese IME).

Issue Number: #24669

What is the new behavior?

To prevent conflicts with IMEs and preserve the patch from the PR that introduced the new issue, it is recommended that we bind event listeners to compositionstart and compositionend to detect when a composition event from an IME is occurring and skip writing the value to the native input control while the event is in flight (inspired from: ng-select/ng-select#1274)

  • Usage of Japanese IME does not result in duplicate values
  • Japanese IME usage of the back button/delete key is restored

Does this introduce a breaking change?

  • Yes
  • No

Other information

While triaging this issue, a Stencil bug was discovered (stenciljs/core#3235) that prevents using the JSX bindings for the composition events.

To verify this issue, you can temporarily add a Japanese keyboard to your iOS device and open the basic input test in the browser. A guide on how to add the keyboard is available here: https://techwiser.com/use-japanese-keyboard-iphone.

@sean-perkins sean-perkins requested a review from a team February 8, 2022 03:55
@github-actions github-actions bot added the package: core @ionic/core package label Feb 8, 2022
@sean-perkins
Copy link
Contributor Author

The community member that reported the issue attached to this PR, commented that the dev build of this PR resolves their issue: #24669 (comment)

Copy link
Contributor

@averyjohnston averyjohnston left a comment

Choose a reason for hiding this comment

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

LGTM once Liam's comments are addressed 👍

Copy link
Contributor

@liamdebeasi liamdebeasi left a comment

Choose a reason for hiding this comment

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

Great job!

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

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants