Repository navigation
refactored LoginForm to function component - #22224
Conversation
|
@narefyev91 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] |
| } | ||
| this.input.focus(); | ||
| } | ||
| function LoginForm({account, blurOnSubmit, closeAccount, isVisible, network, translate}) { |
There was a problem hiding this comment.
i think for code requirements we do not use destructed props - you should use here function LoginForm(props)
There was a problem hiding this comment.
Hi, @narefyev91
Updated to use the structured props.
| if (!canFocusInputOnScreenFocus() || !input.current || !isVisible) { | ||
| return; | ||
| } | ||
| if (blurOnSubmit) { |
There was a problem hiding this comment.
combine both did mount and did update - may potentially trigger input.current.blur(); in situations where it should not, for example anything changed in input ref, which will trigger use effect and if blurOnSubmit will be exists - user will see blur and after focus event on inputs, which is not correct. I will suggest to separate this 1 useEffect to 2
There was a problem hiding this comment.
Hi, @narefyev91
Separated 1 useEffect to 2 useEffect following your suggestion.
Please check.
Reviewer Checklist
Screenshots/VideosWebweb1.movweb2.movMobile Web - Chromeandroid-web1.movandroid-web2.movMobile Web - Safariios-web1.movios-web2.movDesktopdesktop1.movdesktop2.moviOSios1.movios2.movAndroidandroid1.movandroid2.mov |
narefyev91
left a comment
There was a problem hiding this comment.
LGTM!
🎀 👀 🎀 C+ reviewed
…to 16299_refactor_LoginForm
|
✋ 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/luacmartins in version: 1.3.38-0 🚀
|
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.38-7 🚀
|
|
This PR caused a regression. Please look into the root cause in #23797 (comment) for the details. |
| if (!canFocusInputOnScreenFocus() || !input.current || !props.isVisible) { | ||
| return; | ||
| } | ||
| input.current.focus(); |
There was a problem hiding this comment.
Adding this caused #28610. Not sure if the setTimeout was allowed when this PR was created but thought that it would help in the future.
Details
Migrated LoginForm.js to function component.
Fixed Issues
$ #16299
PROPOSAL: #16299 (comment)
Tests
asdfgOffline tests
Follow the same steps in the section above but Continue button doesn't work.
QA Steps
Follow the same steps in the section above
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
Chrome.mp4
Mobile Web - Chrome
Android-Chrome.mov
Mobile Web - Safari
iOS-safari.mp4
Desktop
desktop.mp4
iOS
iOS.mp4
Android
Android.mp4