Skip to content

Conversation

@akivab
Copy link
Contributor

@akivab akivab commented Jan 9, 2021

Addresses #775

@akivab
Copy link
Contributor Author

akivab commented Jan 9, 2021

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)];
Copy link
Contributor Author

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

@akivab akivab changed the title Try to fix the autofill issue Fix OTP autofill by using UITextField in FUICodeField Jan 9, 2021
@morganchen12 morganchen12 self-assigned this Jan 11, 2021
@akivab
Copy link
Contributor Author

akivab commented Jan 19, 2021

Hi @morganchen12 any update on this?

@morganchen12
Copy link
Contributor

Thanks for the PR @akivab, were you able to test this on device? If not I can test it tomorrow.

@akivab
Copy link
Contributor Author

akivab commented Jan 21, 2021

Hi, would be great if you could test as well, thanks!

Copy link
Contributor

@morganchen12 morganchen12 left a 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;
Copy link
Contributor

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.

Copy link
Contributor

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!

@morganchen12 morganchen12 merged commit c0c5774 into firebase:master Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 participants