Open afnx opened 3 years ago
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 TextField
s in an AutofillGroup
?
@LongCatIsLooong, the issue still persists after using AutofillGroup
.
Hi @afnx Thanks for filing the issue, looks similar to https://github.com/flutter/flutter/issues/80423, I can reproduce the issue on multiple channels
Used the following minimal code sample
stable |
master |
---|---|
❌ | ❌ |
Check flutter doctor -v
outputs for each channel below
✅: No Issue ❌: Issue reproduced
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
- Open Settings on iOS Simulator or an iPhone.
- Go to Passwords.
- Add a new password (if you haven't before).
- Go to AutoFill Passwords.
- Enable AutoFill Passwords.
- Run the Flutter code below:
minimal code sample
- Switch between TextFields.
- Notice that the keyboard flickers and causes the button to flicker as well.
Details
- I tested it on both Simulator and a real device. I got the same result.
- Flutter version is
Flutter 2.2.3 • channel stable
.- The issue doesn't occur when I disable AutoFill Passwords.
- No difference between the debug and release modes regarding to the issue.
- This might be related: Keyboard on iOS flashes when switching between textfields when obscured and crash #64628.
I had the same error when using obsecure = true
in browser of iPhone
so I wrote a custom textFormField called passwordTextFormField, you can see my article in this link:
https://github.com/MahdiGharooni/flutter_macos_obscureText
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 obscureText
set to true
. It doesn't seem to matter whether autofill is enabled or not, or whether it's in an autofill group.
@MahdiGharooni - Did you say that disabling AutoFill Passwords helped? If so, can you describe how to do that? I've already tried:
autofillHints: null
enableSuggestions: false
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.
Second, I used a custom textFormField with obscure=false
. You can find it in my GitHub profile: https://github.com/MahdiGharooni/flutter_macos_obscureText
if you use it please share your comments
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 autoCorrect
set to false
.
Setting autoCorrect
to false
also causes the error:
[LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x280983160 'assistantHeight' SystemInputAssistantView.height == 55 (active, names: SystemInputAssistantView:0x100d98570 )>",
"<NSLayoutConstraint:0x2809fce10 'assistantView.bottom' SystemInputAssistantView.bottom == _UIKBCompatInputView:0x100dc3710.top (active, names: SystemInputAssistantView:0x100d98570 )>",
"<NSLayoutConstraint:0x2809fc370 'assistantView.top' V:|-(0)-[SystemInputAssistantView] (active, names: SystemInputAssistantView:0x100d98570, '|':UIInputSetHostView:0x12c1ce730 )>",
"<NSLayoutConstraint:0x28098cf50 'inputView.top' V:|-(0)-[_UIKBCompatInputView:0x100dc3710] (active, names: '|':UIInputSetHostView:0x12c1ce730 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x2809fce10 'assistantView.bottom' SystemInputAssistantView.bottom == _UIKBCompatInputView:0x100dc3710.top (active, names: SystemInputAssistantView:0x100d98570 )>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.```
Any updates on this? In my case if I set autocorrect: false
the flickering goes away and I can still using obscureText
+ autofillHints
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 autofillHints
set e.g.: [AutofillHints.username]
. It is still present in the latest Beta Flutter 3.15.0-15.1.pre
. When removing autofillHints
the flickering disappears, which leads me to believe that the issue is connected to the autofill hints bar above the keyboard.
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: https://github.com/flutter/flutter/issues/134723
In which case I see someone working on it 😄
Hi,
I got the same issue. I am using FlutterFlow to build an app, so it is based on flutter and I have access to the flutter code.
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. Taking a classic textField, as soon as adding 'obscureText = true' the bug is triggered. I try to add "autocorrect: false" but it did not work.
Did you find any solution?
I use Flutter 3.13.2. I build the archive via Xcode. I tested on several Iphone device simulators as well as on real devices, same results everywhere.
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). I turned off autocorrect, autofillHints to use obscure text. This is my code:
obscureText: true or false, // you can use obscureText
autofillHints: const <String>[AutofillHints.oneTimeCode],
autocorrect: false,
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?
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.https://user-images.githubusercontent.com/12843244/129736966-5efed6d0-0298-4294-af8e-04f4939f917f.mp4
Steps to Reproduce
minimal code sample
Details
Flutter 2.2.3 • channel stable
.