Skip to content

Wrong TextEditingDeltas are reported to client writing Japanese - Romaji on Web #131335

@Amir-P

Description

@Amir-P

Is there an existing issue for this?

Steps to reproduce

  1. Open system setting
  2. Select "Keyboard Tab"
  3. Select "Edit" under Text input - Input Sources
  4. Click on the "+" sign at the lower bottom
  5. Select "Japanese - Romaji" and "add"
  6. Make sure "Show input menu in menu bar" is enabled
  7. Click "Done"
  8. On the top right screen, you should see [A] icon. Click on it and change it to [あ]
  9. Click again and uncheck ”Live conversion" because it does some smart conversion but the behavior is inconsistent.
  10. In [あ] Japanese input mode, type "kyouha", hit [space] to convert it to Kanji.

Expected results

According to what @alex-yolabs said in fleather-editor/fleather#150, We should end up with "今日は".

Actual results

The editing deltas reported to input client results in "きょうは今日は" on Web. It works fine when running the app on macOS.

Code sample

There is a fully working example at https://github.com/Amir-P/flutter_ime_romaji_web_issue. I've copied the EditableText from packages/flutter/lib/src/widgets/editable_text.dart and modified it (Amir-P/flutter_ime_romaji_web_issue@ee20bef) to make it use DeltaTextInputClient.

Screenshots or Video

Screenshots / Video demonstration
Screen.Recording.2023-07-26.at.18.13.08.mov

Logs

Logs

Notice the last delta.

macOS:

TextEditingDeltaInsertion: start: 0, end: 0, data: k
TextEditingDeltaInsertion: start: 1, end: 0, data: y
TextEditingDeltaReplacement: start: 0, end: 2, data: きょ
TextEditingDeltaInsertion: start: 2, end: 0, data: う
TextEditingDeltaInsertion: start: 3, end: 0, data: h
TextEditingDeltaReplacement: start: 0, end: 4, data: きょうは
TextEditingDeltaReplacement: start: 0, end: 4, data: 今日は

Chrome:

TextEditingDeltaInsertion: start: 0, end: 0, data: k
TextEditingDeltaInsertion: start: 1, end: 0, data: y
TextEditingDeltaReplacement: start: 0, end: 2, data: きょ
TextEditingDeltaInsertion: start: 2, end: 0, data: う
TextEditingDeltaInsertion: start: 3, end: 0, data: h
TextEditingDeltaReplacement: start: 0, end: 4, data: きょうは
TextEditingDeltaInsertion: start: 4, end: 0, data: 今日は

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.10.6, on macOS 13.4.1 22F770820d darwin-arm64,
    locale en-US)
    • Flutter version 3.10.6 on channel stable at /flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f468f3366c (2 weeks ago), 2023-07-12 15:19:05 -0700
    • Engine revision cdbeda788a
    • Dart version 3.0.6
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /SDK
    • Platform android-33, build-tools 33.0.0
    • ANDROID_HOME = /SDK
    • Java binary at: /Applications/Android
      Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      11.0.15+0-b2043.56-8887301)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E300c
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      11.0.15+0-b2043.56-8887301)

[✓] VS Code (version 1.80.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.68.0

[!] Proxy Configuration
    • HTTP_PROXY is set
    ! NO_PROXY is not set

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 13.4.1 22F770820d
      darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 111.0.5563.64

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: internationalizationSupporting other languages or locales. (aka i18n)a: text inputEntering text in a text field or keyboard related problemsfound in release: 3.10Found to occur in 3.10found in release: 3.13Found to occur in 3.13frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-webOwned by Web platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions