-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Prevent potential duplication of adding the event listeners #22991
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
Prevent potential duplication of adding the event listeners #22991
Conversation
|
@stitesExpensify 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] |
Reviewer Checklist
Screenshots/VideosWeb2023-07-17_13-44-24.mp4Mobile Web - ChromeMobile Web - SafariiOSAndroid |
stitesExpensify
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
0xmiroslav
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.
Looks good!
@stitesExpensify are you filling checklist?
|
@0xmiroslav Adding you since you were assigned on the issue |
|
Desktop app works well. I tested against on main overwriting DragAndDrop/index.js file. desktop.mov
May be this was fixed on main after this PR created. 395 commits behind. |
|
@kosmydel can you pull main and push again please? |
|
Hey, |
|
Desktop is working for me now! |
|
✋ 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/stitesExpensify in version: 1.3.44-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.3.44-2 🚀
|
|
🚀 Deployed to staging by https://github.com/stitesExpensify in version: 1.3.45-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.45-7 🚀
|
|
@stitesExpensify can you please create payment GH for me? |
|
Created an issue here #25775 |
Thanks |


Details
Refactor
componentDidUpdateto prevent calling theaddEventListenersmultiple times.Previously, it was theoretically possible:
we could call the
this.addEventListeners()twice (whenisFocusedanddisabledare changed at the same time from (false/true) to (true/false).The listeners wouldn't be registered multiple times anyway (slack thread), because we use named functions. We introduce this change because calling multiple times this method would cause some unnecessary calculations.
Fixed Issues
$ #19263 (comment)
$ Slack thread
Tests
Web/Desktop/mWeb iOS:
mWeb Android:
I couldn't find the drag-and-drop option on my Android device.
iOS/Android:
Those platforms are not affected by this PR and don't have drag-and-drop functionality.
Offline tests
Checked if the drag-and-drop works offline.
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
web.mov
Mobile Web - Chrome
mweb-android.mp4
Mobile Web - Safari
mweb-ios.mov
Desktop
desktop.mov
iOS
Not related to iOS (doesn't have drag-and-drop implemented).
Android
Not related to Android (doesn't have drag-and-drop implemented).