-
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
fix "Upload photo" popup menu not hiding #13448
Conversation
@marcaaron @thesahindia One of you needs to 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] |
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 and thanks for the quick fix! Going to apply the CP Staging label since this is for a deploy blocker.
|
@@ -41,6 +41,9 @@ class AttachmentPicker extends React.Component { | |||
// Cleanup after selecting a file to start from a fresh state | |||
this.fileInput.value = null; | |||
}} | |||
|
|||
// Prevent parent's onclick event from firing |
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.
ideally this would say why and not just what - something like
We are stopping the event propagation because triggering the
click()
on the hidden input causes the event to unexpectedly bubble up to anything wrapping this component e.g. Pressable
That is better since someone will look at this later and have some idea about why the click event propagation needs to be stopped.
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.
Thanks for your suggestion. updated
Reviewer Checklist
Screenshots/VideosWeb2022-12-08_18-55-04.mp4Mobile Web - ChromeNOT ABLE TO TEST DUE to https://expensify.slack.com/archives/C049HHMV9SM/p1670538280256229 Mobile Web - SafariNOT ABLE TO TEST DUE to https://expensify.slack.com/archives/C049HHMV9SM/p1670538280256229 Desktop2022-12-08_18-56-32.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.
LGTM. I can't test locally on mWeb as there is some sort of crash happening. More context here.
I don't think that should block this PR from going to staging though so gonna merge it without those tests passing on my end.
Nice work with this one @0xmiroslav 🙇 |
fix "Upload photo" popup menu not hiding (cherry picked from commit 5948a0a)
…-13448 🍒 Cherry pick PR #13448 to staging 🍒
🚀 Cherry-picked to staging by @marcaaron in version: 1.2.37-1 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Cherry-picked to staging by https://github.com/AndrewGable in version: 1.3.28-2 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.3.28-5 🚀
|
Details
Prevent parent's onclick event from firing when file input is clicked
Fixed Issues
$ #13435
PROPOSAL: #13435 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesWaiting 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)Screenshots/Videos
Web
web.mov
Mobile Web - Chrome
Mobile Web - Safari
msafari.mp4
Desktop
desktop.mov
iOS
ios.mp4
Android