-
Notifications
You must be signed in to change notification settings - Fork 3k
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
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 |
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
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
componentDidUpdate
to prevent calling theaddEventListeners
multiple times.Previously, it was theoretically possible:
we could call the
this.addEventListeners()
twice (whenisFocused
anddisabled
are 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 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
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).