Fix OTP autofill in iOS Safari#21482
Conversation
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
recheck |
|
@neil-marcellini look's like this one's your issue. Let me know if you need me to review and I'll reassign! |
neil-marcellini
left a comment
There was a problem hiding this comment.
I'll wait to review again until after @thesahindia approves, as per our new process, but here are some initial thoughts.
You say that we can't override the background color. Why not? The user agent stylesheet is simply the default style from the browser, as I understand it, so we should be able to set the backgroundColor here rather than using the transitionDelay hack.
Also, how can we test this in the dev environment?
|
@neil-marcellini you can test it by use your iPhone and receive sms from any number with format: |
I tried to override it but |
|
Quick bump for @thesahindia review. |
It seems like we can't change the backgroundColor but we have one another option. We can use opacity 0 instead of using
on mWeb if you are using the same wifi on your physical ios device and mac then you can open safari and navigate to I couldn't build the native app so will have to ask about in the channel I guess. @ginsuma, did you try building the app on physical device? Also you will need to attach the screenshots of all platforms you can just show the magic input page in other platforms so we know that the changes aren't breaking anything. |
App/src/components/MagicCodeInput.js Lines 299 to 302 in 09a7432 We cannot use opacity: 0 because the Paste option will not show. It happens on iOS/Chrome too.As I know, we don't expect to show the caret on magic code input.
I can't build on real iOS devices.I think we need permission to allow our apple developer account. |
|
Attached the videos of all platforms. |
|
@thesahindia I see on iOS/Chrome cannot show Paste option too because of |
|
Great explanation for why we can't override the background color @ginsuma, thank you. Now I'm happy with the background transition work around. Please explain that in a comment and link to the documentation.
Nice thanks! 👍 |
I not sure about it. I think I have used the paste option in chrome. I will try checking it on my physical device.
hmm, we should test it on physical device. Can you please post about it on the channel. |
|
@thesahindia I asked on Slack but no one can help or tried auto fill magic code from SMS on iOS app. App/src/components/MagicCodeInput.js Line 302 in 6170bec App/src/components/MagicCodeInput.js Line 348 in 6170bec |
|
@thesahindia I have successfully built app on my iPhone. Before and after my commit, the app does not auto fill code from SMS. It's same for Android. I think we don't support it yet. iOS Native Videoios.native.mov |
|
Quick bump for reviewing @thesahindia . |
|
Hey @ginsuma, on prod app, it does work for me on iOS. trim.A66577B0-57C4-4AB1-A145-39DE2DAFE7E2.MOV |
|
@Nikhil-Vats Thank you for your update. Can you tell me where you download prod app? |
|
From the App Store. |
|
@Nikhil-Vats I tried to search it but only the old version https://apps.apple.com/us/app/expensify-receipts-expenses/id471713959. Can you please give me the new version link? |
|
Cannot get auto fill from prod app on my iPhone. prod.app.mp4But my commits only applied for iOS Safari as I said above #21482 (comment). |
|
I changed the phone number and tried again with my build, the autofill works as normal. my.build.mp4 |
|
Cool thanks for testing again. It works on my device as well! I will complete the review today. |
|
@ginsuma, can you help with the instructions on building ios app on my physical device. I didn't find your post on slack. |
Do you have an Apple developer account? In |
Reviewer Checklist
Screenshots/VideosMobile Web - Safaritrim.9C3FB5E3-C66B-4229-B9FC-CB10DEDE2528.MOViOStrim.96FD63F3-B53E-4941-8CC8-DB7CAF17D2D4.MOV |
| color: 'transparent', | ||
| caretColor: 'transparent', | ||
| WebkitTextFillColor: 'transparent', | ||
| // The input text color get background-color after set it to transparent. |
There was a problem hiding this comment.
Let's use this comment -
"After setting the input text color to transparent, it acquires the background-color. However, it is not possible to override the background-color directly as explained in this resource: https://developer.mozilla.org/en-US/docs/Web/CSS/:autofill. Therefore, the transition effect needs to be delayed."
There was a problem hiding this comment.
I updated it. Thank you.
thesahindia
left a comment
There was a problem hiding this comment.
It tested well, just suggested a comment change. I have a doctor's appointment today so approving the PR.
cc: @neil-marcellini
|
Friendly bump @neil-marcellini . |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/neil-marcellini in version: 1.3.38-0 🚀
|
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.38-7 🚀
|
| // After setting the input text color to transparent, it acquires the background-color. | ||
| // However, it is not possible to override the background-color directly as explained in this resource: https://developer.mozilla.org/en-US/docs/Web/CSS/:autofill | ||
| // Therefore, the transition effect needs to be delayed. | ||
| transitionDelay: '99999s', |
There was a problem hiding this comment.
✋ Coming from #28340
We're calculating the height of the input based on onLayout function, but when we navigate to the new page, the layout.height will return 0. Ref: facebook/react-native#10743
After come back to 2FA page, the layout.height is 52px, but we're using transitionDelay:99999s for 2FA input here, that makes the input height is still 0





Details
Fixed Issues
$ #20642
PROPOSAL: #20642 (comment)
Tests
Offline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
mac_safari.mp4
Mobile Web - Safari
result.mp4
Mobile Web - Chrome
Screen.Recording.2023-06-28.at.4.55.55.PM.mov
Desktop
Screen.Recording.2023-06-28.at.5.09.32.PM.mov
iOS
my.build.mp4
Android
Screen.Recording.2023-06-28.at.5.04.04.PM.mov