Skip to content

Ignore ENTER while in text composition mode#5462

Merged
compulim merged 2 commits intomicrosoft:mainfrom
compulim:fix-japanese-ime
Apr 21, 2025
Merged

Ignore ENTER while in text composition mode#5462
compulim merged 2 commits intomicrosoft:mainfrom
compulim:fix-japanese-ime

Conversation

@compulim
Copy link
Copy Markdown
Contributor

@compulim compulim commented Apr 18, 2025

Fixes #5461.

Changelog Entry

Fixed

  • Fixed #5461. On macOS and Fluent skinpack applied, using Japanese IME to input some Japanese text should not send them immediately, in PR #5462, by @compulim

Description

ENTER should not send messages if it is in IME text composition mode.

Design

When browser say they are in text composition mode, it means the IME mini-dialog pops up.

While in text composition mode, ENTER key should not be handled by the browser.

On Windows, when IME mini-dialog pops up, all keys are filtered and will not send to the browser.

On macOS, keys are not (completely) filtered.

In the send box of our Fluent skin pack, it use a multiline textbox (<textarea>) and send on ENTER (new line on SHIFT + ENTER). As macOS did not filter out ENTER, we mistakenly send out the message.

We could not write tests as the behavior works outside of browser and emulating compositionstart event didn't work.

Specific Changes

  • Disable send out the message when ENTER is pressed during compositionstart until compositionend
  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

@compulim compulim marked this pull request as ready for review April 19, 2025 06:03
Copy link
Copy Markdown
Collaborator

@OEvgeny OEvgeny left a comment

Choose a reason for hiding this comment

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

💯

@compulim compulim merged commit 7c4e5a8 into microsoft:main Apr 21, 2025
25 checks passed
@compulim compulim deleted the fix-japanese-ime branch April 21, 2025 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fluent] macOS: Japanese IME conversion key (ENTER) is mistaken

2 participants