-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Fix - Login field is focused when sign out in small screen devices #24026
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
| */ | ||
| export default function usePrevious(value) { | ||
| const ref = useRef(); | ||
| const ref = useRef(value); |
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.
During testing this PR, I found that the prevProp and nextProp always different in beginning. I.e, in this case, !prevIsVisible && props.isVisible is always true in beginning, because prevIsVisible is initialized with undefined, then if props.isVisible has value, !prevIsVisible && props.isVisible is always true in beginning. To solve this issue, I think we have 2 options:
-
Option 1: Always check an addition condition that prevIsVisible is not undefined as well before checking if prevIsVisible is different with props.isVisible.
Pros: We don't touch existing code => It's might not cause any breaking changes.
Cons: It might be our tech debt/code smell later. -
Option 2: Fix this LOC, I think we should pass input value as a initialize value of
ref.
Pros: If we fix here, I think it will work properly/correctly in the future for checking previousProps and nextProps
Cons: It might cause breaking changes. We need to test all current places using it. I have tested a few of them:- FAB, Sign in form, WS member
Screen.Recording.2023-08-03.at.07.04.50.mp4
- Add debit card
I could not test because I could not pass the fill in card number. I asked in slack here https://expensify.slack.com/archives/C01GTK53T8Q/p1691020958967959 - Validate code
Screen.Recording.2023-08-03.at.09.45.46.mp4
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 am fine with either.
|
@thesahindia 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] |
Co-authored-by: Sahil <thesahindia@gmail.com>
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-08-04.at.1.20.08.PM.movMobile Web - ChromeScreen.Recording.2023-08-04.at.1.16.13.PM.movMobile Web - SafariScreen.Recording.2023-08-04.at.1.17.49.PM.movDesktopScreen.Recording.2023-08-04.at.1.21.35.PM.moviOSScreen.Recording.2023-08-04.at.1.23.55.PM.movAndroidScreen.Recording.2023-08-04.at.1.11.17.PM.mov |
thesahindia
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.
Tests well!
PauloGasparSv
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.
LGTM!
|
✋ 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/PauloGasparSv in version: 1.3.51-0 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.3.51-2 🚀
|
|
🚀 Deployed to staging by https://github.com/PauloGasparSv in version: 1.3.52-0 🚀
|
|
🚀 Deployed to staging by https://github.com/PauloGasparSv in version: 1.3.52-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.52-5 🚀
|
Details
Fixed Issues
$ #23797
PROPOSAL: #23797 (comment)
Tests
On Web/Desktop
On mWeb/Native apps
Offline tests
QA Steps
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
Screen.Recording.2023-08-02.at.06.21.30.-.web.mp4
Mobile Web - Chrome
Screen.Recording.2023-08-02.at.06.43.15.-.android.chrome.mov
Mobile Web - Safari
Screen.Recording.2023-08-02.at.06.45.37.-.ios.safari.mov
Desktop
Screen.Recording.2023-08-02.at.06.23.07.-.desktop.mp4
iOS
Screen.Recording.2023-08-02.at.06.44.36.-.ios.mov
Android
Screen.Recording.2023-08-02.at.06.43.55.-.android.mov