AtulParmar
AtulParmar

Reputation: 4570

iOS: UITextField with SecureEntry sometimes highlights yellow color with "Strong Password" text, and then keyboard gets stuck

UITextField with SecureEntry sometimes highlights yellow color with "Strong Password" text, and then the keyboard gets stuck

I haven't able to identify why this issue occurs, Sometimes I am facing this issue when I start typing in UITextField then get a yellow color background with a "Strong Password" text on the right side, and something cut off on the left. I can still tap the UITextField and "Type" but the value does not change within the TextField.

enter image description here

I am using xCode 11.6 and facing this issue with iOS 13.6 simulator.

Upvotes: 6

Views: 2026

Answers (2)

For me, it also helped to change the Content Type for the text field to One Time Code in the registration view. Interestingly that in the same project, I have a similar view "Login view" with a similar text field and there I do not see this issue.

Upvotes: -3

Kapobajza
Kapobajza

Reputation: 2459

As I've discovered this issue while developing a React Native app, I thought it was a bug on the JavaScript level. But it turned out this is an issue on the iOS level.

As far as I have searched, I don't think that there's currently a fix for this bug, but there is a workaround. As stated in this comment: all you have to do is change the textContentType property of the UITextField to oneTimeCode.

You can do it through Xcode, by selecting the UITextField, then switching over to the attributes inspector and selecting the Content Type property to be One Time Code:

One time code UITextField Content Type property

Or directly through code.

Swift:

let textField = UITextField()
textField.textContentType = .oneTimeCode

Objective C:

UITextField *textField = [UITextField new];
textField.textContentType = UITextContentTypeOneTimeCode;

Upvotes: 2

Related Questions