-
Notifications
You must be signed in to change notification settings - Fork 28.5k
iOS Keyboard flickers when switching the TextFields which have obscureText set to true #88354
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
Comments
I can confirm this doesn't happen with the same setup in a UIKit app. @afnx does it stop flickering if you put all 3 |
@LongCatIsLooong, the issue still persists after using |
Hi @afnx Used the following minimal code sample complete minimal runnable code sampleimport 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Material App',
theme: ThemeData.dark(),
home: Home(),
);
}
}
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Material App Bar'),
),
body: AutofillGroup(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
TextField(
obscureText: true,
decoration: InputDecoration(
hintText: "Obscure TextField 1",
),
),
TextField(
obscureText: true,
decoration: InputDecoration(
hintText: "Obscure TextField 2",
),
),
TextField(
obscureText: true,
decoration: InputDecoration(
hintText: "Obscure TextField 3",
),
),
],
),
),
);
}
}
Check flutter doctor -v[✓] Flutter (Channel stable, 2.2.3, on macOS 12.0 21A5304g darwin-x64, locale en-GB)
• Flutter version 2.2.3 at /Users/tahatesser/Code/flutter_stable
• Framework revision f4abaa0735 (7 weeks ago), 2021-07-01 12:46:11 -0700
• Engine revision 241c87ad80
• Dart version 2.13.4
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/tahatesser/Code/SDK
• Platform android-31, build-tools 30.0.3
• ANDROID_HOME = /Users/tahatesser/Code/SDK
• Java binary at: /Users/tahatesser/Code/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment Temurin-11.0.12+7 (build 11.0.12+7)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode-beta.app/Contents/Developer
• Xcode 13.0, Build version 13A5212g
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[!] Android Studio (version 2020.3)
• Android Studio at /Users/tahatesser/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7583922/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
✗ Unable to find bundled Java version.
• Try updating or re-installing Android Studio.
[✓] VS Code (version 1.59.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.25.0
[✓] Connected device (4 available)
• Taha’s iPhone (mobile) • 00008020-001059882212002E • ios • iOS 14.7.1
• iPhone 12 (mobile) • 7CC8A747-CD39-4C42-871C-2D1CCEAE2AE2 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator)
• macOS (desktop) • macos • darwin-x64 • macOS 12.0 21A5304g darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 92.0.4515.159
! Doctor found issues in 1 category.
[✓] Flutter (Channel master, 2.5.0-7.0.pre.130, on macOS 12.0 21A5304g darwin-x64, locale en-GB)
• Flutter version 2.5.0-7.0.pre.130 at /Users/tahatesser/Code/flutter_master
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision d83fba1a22 (5 hours ago), 2021-08-18 03:02:04 -0400
• Engine revision a27da3eeb6
• Dart version 2.15.0 (build 2.15.0-24.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/tahatesser/Code/SDK
• Platform android-31, build-tools 30.0.3
• ANDROID_HOME = /Users/tahatesser/Code/SDK
• Java binary at: /Users/tahatesser/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7583922/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.0)
• Xcode at /Applications/Xcode-beta.app/Contents/Developer
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2020.3)
• Android Studio at /Users/tahatesser/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7583922/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.10+0-b96-7281165)
[✓] Android Studio (version 2020.3)
• Android Studio at /Users/tahatesser/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7583922/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.10+0-b96-7281165)
[✓] VS Code (version 1.59.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.25.0
[✓] Connected device (4 available)
• Taha’s iPhone (mobile) • 00008020-001059882212002E • ios • iOS 14.7.1 18G82
• iPhone 12 (mobile) • 7CC8A747-CD39-4C42-871C-2D1CCEAE2AE2 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator)
• macOS (desktop) • macos • darwin-x64 • macOS 12.0 21A5304g darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 92.0.4515.159
• No issues found!
✅: No Issue ❌: Issue reproduced |
I had the same error when using |
The problem is caused by iOS's autofill function, which can be resolved by turning it off TextField(
...
autofillHints: const <String>[AutofillHints.oneTimeCode],
...
) |
I'm having the same issue, where the screen flickers when the user moves between two fields. It occurs when the password field has @MahdiGharooni - Did you say that disabling AutoFill Passwords helped? If so, can you describe how to do that? I've already tried:
I couldn't find any other way to disable AutoFill Passwords, would appreciate any help! |
First, upgrade your Flutter SDK or change the Flutter branch (master, stable) maybe it's fixed. |
I upgraded the Flutter SDK already, it's not fixed yet. I'll give the custom textFormField a try - thank you! |
@LongCatIsLooong bumping this |
@LongCatIsLooong In my case keyboard flikers on iPad after text submission if
|
Any updates on this? In my case if I set |
This issue can reproduce on flutter 3.7.12, Is there any solution ? |
Exist on channel stable, 3.13.2 as well. |
For me it started to appear with iOS 17 and having |
It has started to happen to me as well since iOS17 |
I can reproduce it on iOS 17. As @LinXunFeng mentioned above, the code snippet could work. However it just breaks the password autofill feature on iOS. TextField(
// now the keyboard doesn't recognize the text field as a password field.
autofillHints: const <String>[AutofillHints.oneTimeCode],
) |
seems to be related to: In which case I see someone working on it 😄 |
Hi, I got the same issue. I did several tests, and as soon as the field is considered as a password, the quicktype bar display the "password" option and it starts to flash/flicker. Did you find any solution? I use Flutter 3.13.2. |
Problem still exists... Flutter 3.22.2 I have an authentication screen with username and password form fields. When I switch between fields, the keyboard size changes momentarily. The extra top space for password selection hides for a few milliseconds and then reverts to its previous state. I use an Expanded widget with an app logo, so everything resizes without any animation, which gives the app an unpleasant and unpolished feeling. When I switch off autofillHints and obscureText, iOS doesn't identify those fields as username/password and doesn't show the keyboard's extra top space for password selection. But this is not a solution... We need proper behaviour. |
Temporary solution (but it is not the best solution, problem still in flutter version 3.22.2).
Note: this is a temporary solution. We need proper behavior. |
Assignees: No one assigned Guys, it's a joke. Is Flutter dead? Should we migrate to something else? |
Google, please do something with that issue. |
Any update? |
Any news? Bug is really ugly... |
I really like flutter, but this is not good... Should we switch to flock or other technology? |
for future devs coming here. This happens natively using SwiftUI, so it's not a flutter issue. |
Switching the TextFields which have
obscureText
set to true causes iOS Keyboard with AutoFill Passwords enabled to flicker. This also affects the widgets due to the change in the keyboard height. There is apparently no issue when AutoFill Passwords is disabled.issue.mp4
Steps to Reproduce
minimal code sample
Details
Flutter 2.2.3 • channel stable
.The text was updated successfully, but these errors were encountered: