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

[FormBuilderTextField]: Cannot swith to chinese keyborad with keyboardType: TextInputType.text #1369

Open
2 of 7 tasks
ginnyhuang opened this issue Feb 19, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@ginnyhuang
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Package/Plugin version

9.1.0

Platforms

  • Android
  • iOS
  • Linux
  • MacOS
  • Web
  • Windows

Flutter doctor

Flutter doctor
[√] Flutter (Channel master, 3.19.0-4.0.pre.1, on Microsoft Windows [版本 10.0.19045.4046], locale zh-TW)
    • Flutter version 3.19.0-4.0.pre.1 on channel master at C:\Software\Flutter\flutter_windows_3.10.6-stable\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision eeebee623e (6 weeks ago), 2024-01-09 22:25:40 -0500
    • Engine revision 1cf2e0a603
    • Dart version 3.4.0 (build 3.4.0-11.0.dev)
    • DevTools version 2.31.0

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\WishMobile\AppData\Local\Android\Sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = C:\Users\WishMobile\AppData\Local\Android\Sdk\;
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)
    • All Android licenses accepted.

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

[√] Visual Studio - develop Windows apps (Visual Studio Build Tools 2022 17.6.4)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools
    • Visual Studio Build Tools 2022 version 17.6.33815.320
    • Windows 10 SDK version 10.0.22000.0

[√] Android Studio (version 2022.2)
    • 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 17.0.6+0-b2043.56-9586694)

[√] VS Code (version 1.85.1)
    • VS Code at C:\Users\WishMobile\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.80.0

[√] Connected device (4 available)
    • Pixel 6 (mobile)  • adb-1C071FDF600A6H-w3OtAw._adb-tls-connect._tcp • android-arm64  • Android 14 (API 34)
    • Windows (desktop) • windows                                         • windows-x64    • Microsoft Windows [版本 10.0.19045.4046]
    • Chrome (web)      • chrome                                          • web-javascript • Google Chrome 121.0.6167.185
    • Edge (web)        • edge                                            • web-javascript • Microsoft Edge 121.0.2277.128

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

• No issues found!

Minimal code example

Code sample
Column(
      children: [
        Text("FormBuilderTextField with TextInputType.text"),
        FormBuilderTextField(
          keyboardType: TextInputType.text,
          name: 'test1',
        ),
        SizedBox(
          height: 8,
        ),
        Text("TextField with TextInputType.text"),
        TextField(
          keyboardType: TextInputType.text,
        ),
        SizedBox(
          height: 8,
        ),
        Text("FormBuilderTextField with TextInputType.name"),
        FormBuilderTextField(
          keyboardType: TextInputType.name,
          name: 'test2',
        ),
        SizedBox(
          height: 8,
        ),
        Text("TextField with TextInputType.name"),
        TextField(
          keyboardType: TextInputType.name,
        ),
        SizedBox(
          height: 8,
        ),
        Text("FormBuilderTextField with TextInputType.emailAddress"),
        FormBuilderTextField(
          keyboardType: TextInputType.emailAddress,
          name: 'test3',
        ),
        SizedBox(
          height: 8,
        ),
        Text("TextField with TextInputType.emailAddress"),
        TextField(
          keyboardType: TextInputType.emailAddress,
        ),
        SizedBox(
          height: 8,
        ),
      ],
    )

Current Behavior

Using FormBuilderTextField with TextInputType.text cannot swith keyboard language in Chinese, but using the origin TextField in flutter can switch keyboard language to Chinese.
I've try another TextInputType: TextInputType.mutiline, it has the same issue, too.
On the contrary, TextInputType.name, TextInputType.emailAddress and TextInputType.streetAddress can swtich to Chinese keyboard both in FormBuilderTextField and TextField. ( But the keyboard still has some tiny different. )

The below is a sample film to show the FormBuilderTextField and TextField with TextInputType.text, TextInputType.name and TextInputType.emailAddress.

no_chinese_keyboard_with_TextInputType_text_small.mp4

Expected Behavior

FormBuilderTextField with TextInputType.text can switch to chinese keyboard.

Steps To Reproduce

  1. With flutter version 3.19.0-4.0.pre.1 and dart version 3.4.0.
  2. Test device ( Android OS ) need to enable language and keyboard of Traditional Chinese ( zh-TW ). I've try Japanese has same issue, too. Maybe any non-English language can reproduce this issue.
  3. Use following code to test FormBuilderTextField TextInputType.text. Click FormBuilderTextField to open keyboard and try to switch the language, and you will discover this issue.

Aditional information

I face this issue after I upgrade the version of flutter and dart. The previous version I've used is 3.13.5 ( flutter ) and 3.1.2 ( dart ), and it work correct. I'm not sure witch flutter version will cause the issue.
I've try to update this libs version to the newest ( 9.2.1 ) and it still not work.
It only appears in Android device. In iOS system it works fine.

In the final, thanks for your reading and help! :)

@ginnyhuang ginnyhuang added the bug Something isn't working label Feb 19, 2024
@yo1106
Copy link

yo1106 commented Feb 19, 2024

Hello,

I noticed that the input issue might be related to the enableSuggestions property being set to false. Have you tried setting enableSuggestions to true to see if it resolves the problem with the Chinese input?

Enabling suggestions could allow the keyboard to provide predictive text and assist with the input in various languages, including Chinese.

@ginnyhuang
Copy link
Author

yo1106
Hello,

I noticed that the input issue might be related to the enableSuggestions property being set to false. Have you tried setting enableSuggestions to true to see if it resolves the problem with the Chinese input?

Enabling suggestions could allow the keyboard to provide predictive text and assist with the input in various languages, including Chinese.

Thanks a lot, it works! It saves my life. I didn't notice the parameter before.
It's magic that enableSuggestions related to keyboard language.

Here's the intorduction of this flag in Andoird: TYPE_TEXT_FLAG_NO_SUGGESTIONS
Maybe it's better to set default value true for enableSuggestions?

Again, thank you for your quick and accurate advice! :)

@Aashish-Dahal
Copy link

It works fine on my app after setting up enableSuggestions to true, Thank you 🙇 @yo1106
Screenshot 2024-03-19 at 9 46 53 AM

@netsesame2
Copy link

save my time, also.

@amotalles
Copy link

saved my day.

FormBuilderTextField(
enableSuggestions: true,

@guppy-jonathan
Copy link

It saved my day.
Thanks

@kentomiya89
Copy link

me too

thk!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants