flutter_chat_ui icon indicating copy to clipboard operation
flutter_chat_ui copied to clipboard

SendButtonVisibilityMode.editing breaks Chinese Input

Open singularity-s0 opened this issue 2 years ago • 2 comments

General

What bug do you experience? 🐞

In lib/src/widgets/input/input.dart, when SendButtonVisibilityMode is set to SendButtonVisibilityMode.editing, the _handleTextControllerChange() function calls setState() whenever a character is entered, which breaks Chinese IME on macOS. When the first character is entered (so that _sendButtonVisible changes from false to true), the view is updated, causing the IME to lose focus on the currently typing word.

How can it be reproduced? 🤔

Step 1. Compile a sample app for Web and open it on macOS Safari (not tested on other devices) Step 2. Switch to Chinese IME Step 3. Type something

What behavior is expected? 💡

Should behave as if typing in a normal text field. (But, as described above, the IME loses (and regains) focus after the first character is typed, resulting in the IME losing the first character)


Environment info

flutter: 3.7.1 flutter-chat-ui: 1.6.6

flutter doctor -v output 👇

[✓] Flutter (Channel stable, 3.7.1, on macOS 13.2 22D49 darwin-x64, locale en-US)
    • Flutter version 3.7.1 on channel stable at /Users/singularity/Projects/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7048ed95a5 (6 days ago), 2023-02-01 09:07:31 -0800
    • Engine revision 800594f1f4
    • Dart version 2.19.1
    • DevTools version 2.20.1

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


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

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

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

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

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

[✓] Connected device (3 available)
    • iPhone 14 Pro Max (mobile) • 9AADEBDE-B971-4B5B-9E37-A743968DAD5A • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-2 (simulator)
    • macOS (desktop)            • macos                                • darwin-x64     • macOS 13.2 22D49 darwin-x64
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome 109.0.5414.119

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 3 categories.

Platform

Device (e.g. Android emulator, iOS simulator, Samsung Galaxy S21): macOS Safari

OS version (e.g. iOS 14.5, Android 11): macOS 13.2


singularity-s0 avatar Feb 08 '23 09:02 singularity-s0

Yes, I also encountered such a problem.

ZhouFung avatar Feb 13 '23 03:02 ZhouFung

I filed this as an issue in https://github.com/flutter/flutter/issues/120763

singularity-s0 avatar Feb 15 '23 08:02 singularity-s0

this is not a feature anymore in v2 - send button always visible.

demchenkoalex avatar Oct 29 '24 19:10 demchenkoalex