You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The keyboard will disappear when switch focus on two TextField when secure keyboard is enabled #68571
On my login page, I have two TextField, one for username(obscureText: false,), one for password(obscureText: true,).
after finish the username input, I click in the password textfield, the keyboard will disappear even if the password textfield get the focus. It will appear when click again! Then, click username textfield again, the keyboard not appear also.
I have open the system secure keyboard:
To enable Secure Keyboard, go to [Settings] > [Additional Settings] > [Keyboard & Input Method] and toggle on [Use Secure Keyboard When Entering a Password].
If I close the system secure keyboard, everything is ok!!
this is my flutter doctor -v
[√] Flutter (Channel stable, 1.20.4, on Microsoft Windows [Version 10.0.18362.1082], locale zh-CN)
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Android Studio (version 3.5)
[√] IntelliJ IDEA Ultimate Edition (version 2018.3)
[√] Connected device (1 available)
Hi @ondev
Can you please provide your flutter doctor -v and a minimal complete reproducible code sample?
The flutter doctor you provided is not complete!
I have a very similar issue, since i upgraded to Flutter 1.22.2 Stable this morning:
[✓] Flutter (Channel stable, 1.22.2, on Linux, locale hu_HU.UTF-8)
• Flutter version 1.22.2 at /home/fazekas/flutter
• Framework revision 84f3d28 (5 days ago), 2020-10-15 16:26:19 -0700
• Engine revision b8752bb
• Dart version 2.10.2
It was working as intended (when i entered the username, and hit the 'Next' button, the focus moved to the password textfield) until the upgrade happened. Since then, when i hit the Next button, the keyboard just disapperars, and nothing happens.
I have a very similar issue, since i upgraded to Flutter 1.22.2 Stable this morning:
[✓] Flutter (Channel stable, 1.22.2, on Linux, locale hu_HU.UTF-8)
• Flutter version 1.22.2 at /home/fazekas/flutter
• Framework revision 84f3d28 (5 days ago), 2020-10-15 16:26:19 -0700
• Engine revision b8752bb
• Dart version 2.10.2
Quick update, i downgraded flutter to 1.20.4, and everything is working fine again.
Hi @ondev
Can you please provide your flutter doctor -v and a minimal complete reproducible code sample?
The flutter doctor you provided is not complete!
Thank you
Here is my sample code, If I close the 'Use Secure Keyboard When Entering a Password' in the device system setting, have no such issue. It's same as the system use two keyboards to switch.
I can confirm the workaround works. Tested on iPhone SE with Flutter 1.22.2. The documentation and sample code for onSubmitted does say that it should work, but it does not. So, it seems that a bug was introduced in 1.22. However, using onEditingComplete does seem to suffice as a workaround. Not sure if there are any drawbacks to using this callback instead?
Note: Keyboard just disappears when secure keyboard is on, there is no flash as seen in the gif when keyboard disappear, recording only shows black it's not the case when you using the app
My team occurred this problem in device Oppo Neo 3 with Android 10, And we tested HUAWEI with Android 10 also faced the same problem. When you turn system secure keyboard off, the issue will disappear.
We found a way to solve this issue, but not sure there would have any side effect. Nice to hear some feedback.
We, too, are running into this issue, and it seems @hardmen's solution doesn't work in our case, perhaps because we're using the TextFormField instead of TextField...
when clicking on a field (in the emulator) we get some print outs:
W/IInputConnectionWrapper( 6533): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper( 6533): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper( 6533): beginBatchEdit on inactive InputConnection
W/IInputConnectionWrapper( 6533): endBatchEdit on inactive InputConnection
I can't reproduce the issue on Funtouch OS_9 PD1913_A_1.16.5 (or EMUI 8.2.0). I have the "Security Input" feature enabled. Sample code used: #68571 (comment).
Check flutter doctor -v outputs for each channel below
flutter doctor -v
[✓] Flutter (Channel stable, 2.5.1, on Microsoft Windows [Version 10.0.22000.194], locale en-US) • Flutter version 2.5.1 at C:\Users\Taha\Code\flutter_stable • Upstream repository https://github.com/flutter/flutter.git • Framework revision ffb2ecea52 (12 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\Taha\Code\android-sdk • Platform android-31, build-tools 31.0.0 • ANDROID_SDK_ROOT = C:\Users\Taha\Code\android-sdk • Java binary at: C:\Users\Taha\Code\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\Google\Chrome\Application\chrome.exe[✓] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.3) • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community • Visual Studio Community 2019 version 16.11.31702.278 • Windows 10 SDK version 10.0.19041.0[✓] Android Studio (version 2020.3) • Android Studio at C:\Users\Taha\Code\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.2) • VS Code at C:\Users\Taha\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.26.0[✓] Connected device (4 available) • RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64 • Android 11 (API 30) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22000.194] • Chrome (web) • chrome • web-javascript • Google Chrome 94.0.4606.61 • Edge (web) • edge • web-javascript • Microsoft Edge 93.0.961.47• No issues found
[✓] Flutter (Channel master, 2.6.0-12.0.pre.135, on Microsoft Windows [Version 10.0.22000.194], locale en-US) • Flutter version 2.6.0-12.0.pre.135 at C:\Users\Taha\Code\flutter_master • Upstream repository https://github.com/flutter/flutter.git • Framework revision 3074c9e04b (9 hours ago), 2021-09-28 22:08:04 -0700 • Engine revision bccb3a57eb • Dart version 2.15.0 (build 2.15.0-156.0.dev)[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) • Android SDK at C:\Users\Taha\Code\android-sdk • Platform android-31, build-tools 31.0.0 • ANDROID_SDK_ROOT = C:\Users\Taha\Code\android-sdk • Java binary at: C:\Users\Taha\Code\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\Google\Chrome\Application\chrome.exe[✓] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.3) • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community • Visual Studio Community 2019 version 16.11.31702.278 • Windows 10 SDK version 10.0.19041.0[✓] Android Studio (version 2020.3) • Android Studio at C:\Users\Taha\Code\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.2) • VS Code at C:\Users\Taha\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.26.0[✓] Connected device (5 available) • RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64 • Android 11 (API 30) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22000.194] • Windows (UWP) (desktop) • winuwp • windows-uwp-x64 • • Chrome (web) • chrome • web-javascript • Google Chrome 94.0.4606.61 • Edge (web) • edge • web-javascript • Microsoft Edge 93.0.961.47• No issues found!
I was able to reproduce the issue on a RMX2001. It seems the keyboard isn't showing up because the framework calls showSoftInput first and then tells the input method to restart immediately. Switching the order of these 2 calls seems to fix the problem. Also currently tapping on the target field again should bring up the virtual keyboard.
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.
Activity
pedromassangocode commentedon Oct 20, 2020
Hi @ondev
Can you please provide your
flutter doctor -vand a minimal complete reproducible code sample?The
flutter doctoryou provided is not complete!Thank you
bmxbandita commentedon Oct 20, 2020
I have a very similar issue, since i upgraded to Flutter 1.22.2 Stable this morning:
[✓] Flutter (Channel stable, 1.22.2, on Linux, locale hu_HU.UTF-8)
• Flutter version 1.22.2 at /home/fazekas/flutter
• Framework revision 84f3d28 (5 days ago), 2020-10-15 16:26:19 -0700
• Engine revision b8752bb
• Dart version 2.10.2
Two Textfields in a column like this:
It was working as intended (when i entered the username, and hit the 'Next' button, the focus moved to the password textfield) until the upgrade happened. Since then, when i hit the Next button, the keyboard just disapperars, and nothing happens.
bmxbandita commentedon Oct 20, 2020
Quick update, i downgraded flutter to 1.20.4, and everything is working fine again.
ondev commentedon Oct 21, 2020
Here is my sample code, If I close the 'Use Secure Keyboard When Entering a Password' in the device system setting, have no such issue. It's same as the system use two keyboards to switch.
pedromassangocode commentedon Oct 21, 2020
Hi @ondev
Can you please confirm what device are you using to test this?
I tried to test on a Xiaomi Redmi 5Plus but it don't have this "Use Secure Keyboard When Entering a Password" option.
doc-rj-celltrak commentedon Oct 21, 2020
I have the same issue as @bmxbandita and the issue started with flutter 1.22. Possible workaround here: https://stackoverflow.com/a/64227418/5765232
doc-rj-celltrak commentedon Oct 21, 2020
I can confirm the workaround works. Tested on iPhone SE with Flutter 1.22.2. The documentation and sample code for onSubmitted does say that it should work, but it does not. So, it seems that a bug was introduced in 1.22. However, using onEditingComplete does seem to suffice as a workaround. Not sure if there are any drawbacks to using this callback instead?
ondev commentedon Oct 22, 2020
My phone is Oppo Reno 10. I will try on iPhone.
TahaTesser commentedon Oct 22, 2020
Hi everyone, I can reproduce it on Android 10
Note: Keyboard just disappears when secure keyboard is on, there is no flash as seen in the gif when keyboard disappear, recording only shows black it's not the case when you using the app
complete code sample
flutter doctor -v
[✓] Flutter (Channel stable, 1.22.2, on Mac OS X 10.15.7 19H2, locale en-GB) • Flutter version 1.22.2 at /Users/tahatesser/Code/flutter_stable • Framework revision 84f3d28555 (6 days ago), 2020-10-15 16:26:19 -0700 • Engine revision b8752bbfff • Dart version 2.10.2 [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) • Android SDK at /Users/tahatesser/Code/sdk • Platform android-30, build-tools 30.0.2 • ANDROID_HOME = /Users/tahatesser/Code/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 12.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.1, Build version 12A7403 • CocoaPods version 1.10.0.rc.1 [!] Android Studio (version 4.1) • Android Studio at /Applications/Android Studio.app/Contents ✗ Flutter plugin not installed; this adds Flutter specific functionality. ✗ Dart plugin not installed; this adds Dart specific functionality. • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) [✓] VS Code (version 1.50.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.15.1 [✓] Connected device (1 available) • RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64 • Android 10 (API 29) ! Doctor found issues in 1 category.flutter doctor -v
[✓] Flutter (Channel beta, 1.23.0-18.1.pre, on Mac OS X 10.15.7 19H2 x86_64, locale en-GB) • Flutter version 1.23.0-18.1.pre at /Users/tahatesser/Code/flutter_beta • Framework revision 198df796aa (7 days ago), 2020-10-15 12:04:33 -0700 • Engine revision 1d12d82d9c • Dart version 2.11.0 (build 2.11.0-213.1.beta) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) • Android SDK at /Users/tahatesser/Code/sdk • Platform android-30, build-tools 30.0.2 • ANDROID_HOME = /Users/tahatesser/Code/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 12.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.1, Build version 12A7403 • CocoaPods version 1.10.0.rc.1 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 4.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 1.8.0_242-release-1644-b3-6222593) [✓] VS Code (version 1.50.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.15.1 [✓] Connected device (3 available) • RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64 • Android 10 (API 29) • Web Server (web) • web-server • web-javascript • Flutter Tools • Chrome (web) • chrome • web-javascript • Google Chrome 86.0.4240.80 • No issues found!flutter doctor -v
[✓] Flutter (Channel dev, 1.24.0-1.0.pre, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-GB) • Flutter version 1.24.0-1.0.pre at /Users/tahatesser/Code/flutter_dev • Framework revision 12bea61c29 (7 days ago), 2020-10-14 15:57:04 -0700 • Engine revision 069b3cf8f0 • Dart version 2.11.0 (build 2.11.0-218.0.dev) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) • Android SDK at /Users/tahatesser/Code/sdk • Platform android-30, build-tools 30.0.2 • ANDROID_HOME = /Users/tahatesser/Code/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 12.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.1, Build version 12A7403 • CocoaPods version 1.10.0.rc.1 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 4.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 1.8.0_242-release-1644-b3-6222593) [✓] VS Code (version 1.50.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.15.1 [✓] Connected device (4 available) • RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64 • Android 10 (API 29) • macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.7 19H2 darwin-x64 • Web Server (web) • web-server • web-javascript • Flutter Tools • Chrome (web) • chrome • web-javascript • Google Chrome 86.0.4240.80 • No issues found!flutter doctor -v
[✓] Flutter (Channel master, 1.24.0-2.0.pre.111, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-GB) • Flutter version 1.24.0-2.0.pre.111 at /Users/tahatesser/Code/flutter_master • Framework revision fe189baf34 (6 hours ago), 2020-10-21 22:25:53 -0400 • Engine revision f459a86610 • Dart version 2.11.0 (build 2.11.0-242.0.dev) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) • Android SDK at /Users/tahatesser/Code/sdk • Platform android-30, build-tools 30.0.2 • ANDROID_HOME = /Users/tahatesser/Code/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 12.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.1, Build version 12A7403 • CocoaPods version 1.10.0.rc.1 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 4.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 1.8.0_242-release-1644-b3-6222593) [✓] VS Code (version 1.50.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.15.1 [✓] Connected device (4 available) • RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64 • Android 10 (API 29) • macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.7 19H2 darwin-x64 • Web Server (web) • web-server • web-javascript • Flutter Tools • Chrome (web) • chrome • web-javascript • Google Chrome 86.0.4240.80 • No issues found!28 remaining items
StarOfLife commentedon Nov 16, 2020
The same in HUAWEI nova
hardmen commentedon Nov 24, 2020
My team occurred this problem in device Oppo Neo 3 with Android 10, And we tested HUAWEI with Android 10 also faced the same problem. When you turn system secure keyboard off, the issue will disappear.
We found a way to solve this issue, but not sure there would have any side effect. Nice to hear some feedback.
hr1995 commentedon Jul 26, 2021
I also face the same wrong. flutter sdk 2.0.6 stable, is there any good solution for solving the problem?
The problem is normal in iOS device, but appears on Android.
wkl-coder commentedon Aug 5, 2021
I also face the same wrong. flutter sdk 1.22.6 stable, huawei mate 20 ,is there any good solution for solving the problem? @LongCatIsLooong
lastmeta commentedon Sep 8, 2021
We, too, are running into this issue, and it seems @hardmen's solution doesn't work in our case, perhaps because we're using the TextFormField instead of TextField...
when clicking on a field (in the emulator) we get some print outs:
EDIT:
turns out my issue may not have been this one discussed, or may it is, idk. but this fixed it for me:
https://stackoverflow.com/questions/61952613/getselectedtext-on-inactive-inputconnection-flutter
LongCatIsLooong commentedon Sep 13, 2021
I can't reproduce the issue on Funtouch OS_9 PD1913_A_1.16.5 (or EMUI 8.2.0). I have the "Security Input" feature enabled. Sample code used: #68571 (comment).
TahaTesser commentedon Sep 29, 2021
@LongCatIsLooong
I can still reproduce with Secure Keyboard turned on a Realme device
Used the following minimal code sample
complete minimal runnable code sample
With
Secure KeyboardRecord_2021-09-29-16-59-12_9fa5dad64a740ada74ffb524f5927bf8.mp4
Without
Secure KeyboardRecord_2021-09-29-16-59-46_9fa5dad64a740ada74ffb524f5927bf8.mp4
stablemasterCheck
flutter doctor -voutputs for each channel belowflutter doctor -v
✅: No Issue ❗️: Issue reproduced
LongCatIsLooong commentedon Nov 2, 2021
I was able to reproduce the issue on a RMX2001. It seems the keyboard isn't showing up because the framework calls
showSoftInputfirst and then tells the input method to restart immediately. Switching the order of these 2 calls seems to fix the problem. Also currently tapping on the target field again should bring up the virtual keyboard.[TextInput] issue `setEditingState` before `show` to the text input
github-actions commentedon Dec 8, 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 -vand a minimal reproduction of the issue.