-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
2FA Input field not focused on mobile #20891
2FA Input field not focused on mobile #20891
Conversation
@abdulrahuman5196 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
src/components/MagicCodeInput.js
Outdated
@@ -111,6 +111,11 @@ function MagicCodeInput(props) { | |||
setFocusedIndex(0); | |||
inputRefs.current[0].focus(); | |||
}, | |||
resetFocus() { | |||
setInput(''); | |||
setFocusedIndex(0); |
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.
Instead of below 2 lines we can directly call focus() to avoid duplicate code
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.
@abdulrahuman5196 It will look something like this then. I am not able to call one handler through the other in useImperativeHandle. Or in the same component without extracting to an outside function like blur.
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.
@WikusKriek This seems to be fine IMO if we are unable to call within imperative functions, compared to having duplicate code. We can name it as focusMagicCodeInput
similar to blur
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.
Made the changes.
src/components/MagicCodeInput.js
Outdated
@@ -111,6 +111,11 @@ function MagicCodeInput(props) { | |||
setFocusedIndex(0); | |||
inputRefs.current[0].focus(); | |||
}, | |||
resetFocus() { | |||
setInput(''); | |||
setFocusedIndex(0); |
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.
@WikusKriek This seems to be fine IMO if we are unable to call within imperative functions, compared to having duplicate code. We can name it as focusMagicCodeInput
similar to blur
Reviewer Checklist
Screenshots/VideosWebUntitled.47.mp4Mobile Web - ChromeUntitled.46.mp4Mobile Web - SafariUntitled.48.mp4DesktopUntitled.50.mp4iOSUntitled.49.mp4AndroidUntitled.51.mp4 |
Note: this PR isn't expected to fix issue in mWeb safari since focusing itself is broken in multiple place on mweb safari and its tackled as part of this #10414 |
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 changes looks good and works well. Reviewers checklist is also complete.
All yours. @luacmartins
🎀👀🎀
C+ Reviewed
@luacmartins This PR is pending on your approval. Kindly check on this. |
@abdulrahuman5196 thanks for the ping. I completely missed this one! |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
@luacmartins the PR was still merged within 3 days, excluding weekends? According to the bot in this comment it was not. |
@WikusKriek Melvin's comment was wrong actually. I pinged in the issue itself - #19711 (comment) |
🚀 Deployed to staging by https://github.com/luacmartins in version: 1.3.30-0 🚀
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.3.30-5 🚀
|
Details
2FA did not focus on mobile, created a new resetFocus handler that sets intput, this will focus hte magic code input.
Fixed Issues
$ #19711
PROPOSAL: #19711 (comment)
Tests
Offline tests
N/A
QA Steps
Same as Test Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
MacOS.Chrome.2023-06-16.at.12.39.08.mov
Mobile Web - Chrome
Android.Chrome.2023-06-16.at.12.13.21.mov
Mobile Web - Safari
IOS.safari.2023-06-16.at.12.24.29.mov
Desktop
MacOS.Desktop.2023-06-16.at.12.42.48.mov
iOS
IOS.Native.2023-06-16.at.12.21.53.mov
Android
Android.2023-06-16.at.12.08.50.mov