5

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.

AtulParmar
  • 4,358
  • 1
  • 24
  • 45

1 Answers1

2

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;
Kapobajza
  • 2,254
  • 15
  • 22