Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows][Desktop][IME]: Focus is not reset after entering input in other textfields. Text gets duplicated. #90503

Closed
xyun52 opened this issue Sep 22, 2021 · 17 comments
Assignees
Labels
a: desktop Running on desktop a: internationalization Supporting other languages or locales. (aka i18n) a: text input Entering text in a text field or keyboard related problems engine flutter/engine repository. See also e: labels. f: focus Focus traversal, gaining or losing focus found in release: 2.5 Found to occur in 2.5 found in release: 2.6 Found to occur in 2.6 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P1 High-priority issues at the top of the work list platform-windows Building on or for Windows specifically r: fixed Issue is closed as already fixed in a newer version

Comments

@xyun52
Copy link

xyun52 commented Sep 22, 2021

Switch to other TextInput when input is not complete. Input value confusion
微信截图_20210922144753

@darshankawar darshankawar added the in triage Presently being triaged by the triage team label Sep 22, 2021
@darshankawar
Copy link
Member

@xyun52
Can you provide flutter doctor -v, clear steps to replicate along with actual vs expected behavior ?
Thanks.

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 22, 2021
@xyun52
Copy link
Author

xyun52 commented Sep 23, 2021

Flutter (Channel stable, 2.5.0, on Microsoft Windows [Version 10.0.17763.2183], locale zh-CN)
• Flutter version 2.5.0 at C:\sdks\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 4cc385b (2 weeks ago), 2021-09-07 23:01:49 -0700
• Engine revision f0826da7ef
• Dart version 2.14.0
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn

[X] Android toolchain - develop for Android devices
• Android SDK at C:\Android\android-sdk
X cmdline-tools component is missing
Run path/to/sdkmanager --install "cmdline-tools;latest"
See https://developer.android.com/studio/command-line for more details.

[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Enterprise 2019 16.11.2)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise
• Visual Studio Enterprise 2019 version 16.11.31624.102
• Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2020.3)
• Android Studio at C:\Program Files\Android\Android Studio
• 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.10+0-b96-7249189)

[√] VS Code (version 1.60.1)
• VS Code at C:\Users\X\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.26.0

[√] Connected device (2 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.17763.2183]
• Chrome (web) • chrome • web-javascript • Google Chrome 93.0.4577.82

Steps to reproduce

  1. select first TextInput by mouse, input any character,don't input "space" or "enter".
  2. select next TextInput by mouse, input any character,the input value confusion

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 23, 2021
@xyun52
Copy link
Author

xyun52 commented Sep 23, 2021

this is steps video and the video end new bug, long text select can't scroll

c50c3d862337daa74c249524fa6d16cc.mp4

@darshankawar
Copy link
Member

@xyun52
Tried following your steps to replicate on Windows 10 machine and running a sample app with 2 text fields on desktop. Used mouse to input char / text but didn't observe the behavior you are reporting. Also tried inputing localized char and using soft keyboard, but no issues faced.

char
char_in

flutter doctor -v



[√] Flutter (Channel stable, 2.5.1, on Microsoft Windows [Version 10.0.19042.1237], locale en-US)
    • Flutter version 2.5.1 at D:\FlutterSDK\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ffb2ecea52 (4 days ago), 2021-09-17 15:26:33 -0400
    • Engine revision b3af521a05
    • Dart version 2.14.2

[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at C:\Users\Win\AppData\Local\Android\sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.2)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.11.31624.102
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2020.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • 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.10+0-b96-7249189)

[√] VS Code (version 1.60.1)
    • VS Code at C:\Users\Win\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (4 available)
    • SM A260G (mobile) • 5200763ebcfa861f • android-arm    • Android 8.1.0 (API 27)
    • Windows (desktop) • windows          • windows-x64    • Microsoft Windows [Version 10.0.19042.1237]
    • Chrome (web)      • chrome           • web-javascript • Google Chrome 93.0.4577.82
    • Edge (web)        • edge             • web-javascript • Microsoft Edge 93.0.961.52

• No issues found!

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 23, 2021
@xyun52
Copy link
Author

xyun52 commented Sep 23, 2021

@darshankawar
You may need to use other input methods, such as Chinese input method.
#65574 (comment)

image

image

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 23, 2021
@darshankawar
Copy link
Member

@xyun52
Can you try the solution mentioned in this issue comment and see if it helps ?

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 23, 2021
@xyun52
Copy link
Author

xyun52 commented Sep 23, 2021

@darshankawar
Can't solve the problem i encountered

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 23, 2021
@xyun52
Copy link
Author

xyun52 commented Sep 23, 2021

The beta channel has the same problem

[√] Flutter (Channel beta, 2.6.0-5.2.pre, on Microsoft Windows [Version 10.0.17763.2183], locale zh-CN)
• Flutter version 2.6.0-5.2.pre at C:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 400608f (8 days ago), 2021-09-15 15:50:26 -0700
• Engine revision 1d521d89d8
• Dart version 2.15.0 (build 2.15.0-82.2.beta)
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn

@darshankawar
Copy link
Member

Ok I was able to replicate and see the same behavior as OP using latest master and stable.

Steps to replicate:

  1. Use Chinese Simplied input keyboard.
  2. In Textfield, input ab
  3. In next textfield, input same text (ab) which shows duplicated text from textfield 1.

test

code sample

body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              TextField(
                decoration: InputDecoration(
                    hintText: 'enter'
                ),
              ),
              TextField(
                decoration: InputDecoration(
                    hintText: 'enter'
                ),
              )
            ],
          )
        )

flutter doctor -v

[√] Flutter (Channel master, 2.6.0-6.0.pre.198, on Microsoft Windows [Version 10.0.19042.1237], locale en-US)
    • Flutter version 2.6.0-6.0.pre.198 at D:\FlutterSDK\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision d32960d03a (58 minutes ago), 2021-09-24 01:43:07 -0400
    • Engine revision a5b860a265
    • Dart version 2.15.0 (build 2.15.0-142.0.dev)

[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at C:\Users\Win\AppData\Local\Android\sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.2)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.11.31624.102
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2020.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • 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.10+0-b96-7249189)

[√] VS Code (version 1.60.1)
    • VS Code at C:\Users\Win\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19042.1237]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 93.0.4577.82
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 93.0.961.52

• No issues found!

[√] Flutter (Channel stable, 2.5.1, on Microsoft Windows [Version 10.0.19042.1237], locale en-US)
    • Flutter version 2.5.1 at D:\FlutterSDK\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ffb2ecea52 (4 days ago), 2021-09-17 15:26:33 -0400
    • Engine revision b3af521a05
    • Dart version 2.14.2

[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at C:\Users\Win\AppData\Local\Android\sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.2)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.11.31624.102
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2020.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • 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.10+0-b96-7249189)

[√] VS Code (version 1.60.1)
    • VS Code at C:\Users\Win\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (4 available)
    • SM A260G (mobile) • 5200763ebcfa861f • android-arm    • Android 8.1.0 (API 27)
    • Windows (desktop) • windows          • windows-x64    • Microsoft Windows [Version 10.0.19042.1237]
    • Chrome (web)      • chrome           • web-javascript • Google Chrome 93.0.4577.82
    • Edge (web)        • edge             • web-javascript • Microsoft Edge 93.0.961.52

• No issues found!

@darshankawar darshankawar added a: desktop Running on desktop a: internationalization Supporting other languages or locales. (aka i18n) a: text input Entering text in a text field or keyboard related problems engine flutter/engine repository. See also e: labels. found in release: 2.5 Found to occur in 2.5 found in release: 2.6 Found to occur in 2.6 has reproducible steps The issue has been confirmed reproducible and is ready to work on platform-windows Building on or for Windows specifically f: focus Focus traversal, gaining or losing focus framework flutter/packages/flutter repository. See also f: labels. and removed in triage Presently being triaged by the triage team labels Sep 24, 2021
@darshankawar darshankawar changed the title Windows IME not reset on focus changed [Windows][Desktop][IME]: Focus is not reset after entering input in other textfields. Text gets duplicated. Sep 24, 2021
@xyun52
Copy link
Author

xyun52 commented Sep 28, 2021

@darshankawar
Our customers often click and switch when editing large forms. This problem is very serious and I hope it can be fixed as soon as possible.

@gspencergoog gspencergoog added the P1 High-priority issues at the top of the work list label Sep 30, 2021
@dkwingsmt
Copy link
Contributor

Progress: I'm investigating this issue.

I've managed to reproduce this issue on 2.2.3 as well as the latest master.

It is only triggered with IME with precompose text (MS's Chinese or Japanese input method, but not Sogou input.)

@dkwingsmt
Copy link
Contributor

Seems like it's more of a text input issue. After discussion, I'm assigning it back to cbracken.

@dkwingsmt dkwingsmt removed their assignment Oct 7, 2021
@cbracken cbracken added this to To do in Win32 Desktop Stable via automation Oct 12, 2021
@cbracken cbracken moved this from To do to In progress in Win32 Desktop Stable Oct 12, 2021
cbracken added a commit to cbracken/flutter_engine that referenced this issue Oct 12, 2021
When a text input client is cleared, such as when the user changes focus
from one text input widget to another, or when the window itself loses
focus, cancel IME composing mode, close the composing candidates window
(if any), and reset the composing text.

Issue: flutter/flutter#90503
cbracken added a commit to cbracken/flutter_engine that referenced this issue Oct 13, 2021
When a text input client is cleared, such as when the user changes focus
from one text input widget to another, or when the window itself loses
focus, cancel IME composing mode, close the composing candidates window
(if any), and reset the composing text.

Issue: flutter/flutter#90503
cbracken added a commit to flutter/engine that referenced this issue Oct 13, 2021
When a text input client is cleared, such as when the user changes focus
from one text input widget to another, or when the window itself loses
focus, cancel IME composing mode, close the composing candidates window
(if any), and reset the composing text.

Issue: flutter/flutter#90503
@cbracken cbracken moved this from In progress to Done in Win32 Desktop Stable Oct 13, 2021
@cbracken
Copy link
Member

cbracken commented Oct 13, 2021

This was fixed in flutter/engine#29146. Once it rolls to the framework, it'll be fixed on Flutter master branch.

@xyun52
Copy link
Author

xyun52 commented Oct 14, 2021

@cbracken
@dkwingsmt

A new bug has been generated。
The sougou input method position error.
动画

[√] Flutter (Channel master, 2.6.0-12.0.pre.337, on Microsoft Windows [Version 10.0.17763.2183], locale zh-CN)
• Flutter version 2.6.0-12.0.pre.337 at C:\sdks\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 158939a (88 minutes ago), 2021-10-14 03:58:04 +0300
• Engine revision 2cdac43
• Dart version 2.15.0 (build 2.15.0-208.0.dev)
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn

[√] Visual Studio - develop for Windows (Visual Studio Enterprise 2019 16.11.2)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise
• Visual Studio Enterprise 2019 version 16.11.31624.102
• Windows 10 SDK version 10.0.19041.0

@darshankawar
Copy link
Member

@xyun52
In order to track issues properly, I suggest you to open a new issue and not just comment in the existing one about a different behavior leading to an issue.
Thanks.

@darshankawar darshankawar added the r: fixed Issue is closed as already fixed in a newer version label Oct 14, 2021
@dkwingsmt
Copy link
Contributor

I filed xyun52's issue in a separate one #92050

@github-actions
Copy link

github-actions bot commented Nov 2, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: desktop Running on desktop a: internationalization Supporting other languages or locales. (aka i18n) a: text input Entering text in a text field or keyboard related problems engine flutter/engine repository. See also e: labels. f: focus Focus traversal, gaining or losing focus found in release: 2.5 Found to occur in 2.5 found in release: 2.6 Found to occur in 2.6 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P1 High-priority issues at the top of the work list platform-windows Building on or for Windows specifically r: fixed Issue is closed as already fixed in a newer version
Projects
No open projects
Development

No branches or pull requests

5 participants