-
Notifications
You must be signed in to change notification settings - Fork 487
Fix OTP autofill by using UITextField in FUICodeField #930
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
Conversation
|
Hi @morganchen12 just wanted to open this PR to discuss a possible solution to the autofill issue that keeps coming up, It replaces the custom FUICodeField with a simple UITextField |
| self.tintColor = UIColor.clearColor; | ||
| self.font = [UIFont fontWithName:@"Courier" size:40]; | ||
| self.textAlignment = NSTextAlignmentLeft; | ||
| UIView *paddingView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 20, self.bounds.size.height)]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the cursor in UITextField made me increase the size of the area for the codeField in the FUIPhoneVerificationViewController.xib and add this space here
|
Hi @morganchen12 any update on this? |
|
Thanks for the PR @akivab, were you able to test this on device? If not I can test it tomorrow. |
|
Hi, would be great if you could test as well, thanks! |
morganchen12
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested these changes locally, LGTM with one comment.
| UIView *paddingView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 20, self.bounds.size.height)]; | ||
| self.leftView = paddingView; | ||
| self.leftViewMode = UITextFieldViewModeAlways; | ||
| self.textContentType = UITextContentTypeOneTimeCode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep the if (@available(iOS 12.0, *)) check around this line since it's only available on iOS 12 and higher.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll accept the PR as is and add this line manually since I want to get it into the next release. Thanks @akivab!
Addresses #775