Skip to content

isComposing in onInput is always true while you turn on IME until recomposition only in Chromium #394

@tats-u

Description

@tats-u

https://codepen.io/tats-u/pen/VYZBEWM (simple Markdown-to-HTML playground)

The following process doesn't work in Chromium. Works in Firefox as intended. Which behavior is correct?

document.addEventListener("DOMContentLoaded", () => {
  const textArea = document.querySelector("textarea");
  textArea.addEventListener("input", (event) => {
    if (event.isComposing) { // skip while IME input because it's half-baked
    return;
  }
    // your process here
  });
});

Reproduction:

  1. Open https://codepen.io/tats-u/pen/VYZBEWM in a Chromium-based browser
  2. Turn your IME on (e.g. Google Japanese Input / Microsoft Japanese Input)
  3. Input some Japanese using IME
  4. Press Enter to commit
  • Firefox: the rendered HTML will be changed
  • Chromium: HTML is will not be changed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions