Skip to content

First IME-composed character is lost when typing into an empty block with fontSizeDefaultSelection set (Windows) #5057

Description

@sy-hash

When fontSizeDefaultSelection is configured (to any value other than the default "Font Size") together with the font_size plugin, typing the first character of a Japanese IME composition into an empty block (e.g. a newly created empty paragraph) causes that character to be silently dropped on Windows.

To Reproduce

Steps to reproduce the behavior:

  1. Open the editor with some existing text wrapped in a paragraph, e.g. <p>abc</p> (plain unwrapped text does not reproduce the issue)
  2. Place the cursor at the end of the text and press Enter to create a new empty paragraph
  3. With the IME in Japanese (romaji) input mode, type AIUEO

JSFiddle reproduction: https://jsfiddle.net/zj1kwt74/

<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <script src="https://cdn.jsdelivr.net/npm/froala-editor@5.2.0/js/froala_editor.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/froala-editor@5.2.0/js/plugins/font_size.min.js"></script>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/froala-editor@5.2.0/css/froala_style.min.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/froala-editor@5.2.0/css/froala_editor.pkgd.min.css">
</head>
<body>
  <textarea id="froala-editor">&lt;p&gt;abc&lt;/p&gt;</textarea>
  <script>
    new FroalaEditor('#froala-editor', {
      key: '',
      fontSizeDefaultSelection: '20'
    });
  </script>
</body>
</html>

Expected behavior

Typing AIUEO via the Japanese IME should produce あいうえお (as it does when fontSizeDefaultSelection is not set).

Actual behavior

The first character (A) is dropped entirely. The IME only confirms いうえお, missing the initial あ. The resulting HTML shows the default font size having been applied to the content, e.g.:

<p><span style="font-size: 20px;">いうえお</span></p>
2026-07-02.15.58.36.mov

Environment

  • Froala Editor version: 5.2.0
  • OS: Windows 11 (Windows 11 Pro / 25H2 / 26200.8653)
  • Browser: Edge (149.0.4022.98)
  • IME: Microsoft IME romaji-to-kana input mode

Additional context

This does not reproduce on macOS (Chrome) under the same steps — it appears to be Windows-specific.

As a workaround, not setting fontSizeDefaultSelection avoids the issue entirely.

Activity

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

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