[HOLD for payment 2021-12-06] $500 Holding 2 fingers on PDF opens context menu - Reported by: @parasharrajat
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
- Navigate to a conversation
- Send a PDF
- Open the preview
- Hold 2 fingers over the PDF
Expected Result:
No context menu should be displayed in attachment preview
Actual Result:
Context menu displayed.
Workaround:
None needed.
Platform:
Where is this issue occurring?
- iOS
- Android
Version Number: 1.1.7-22
Reproducible in staging?: Yes Reproducible in production?: Yes
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL:
Issue reported by: @parasharrajat Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1634141035220700
Triggered auto assignment to @yuwenmemon (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
@yuwenmemon Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@yuwenmemon Huh... This is 4 days overdue. Who can take care of this?
Triggered auto assignment to @SofiedeVreese (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
Job posted on Upwork: https://www.upwork.com/jobs/~010ae2998ab7b91209
Triggered auto assignment to @Luke9389 (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@parasharrajat Do you mean the menu with Copy to clipboard, Mark as unread and Delete comment?
If so, why wouldn't we want these options to show up?
Not sure why the video wasn't uploaded here https://expensify.slack.com/archives/C01GTK53T8Q/p1634141057220800?thread_ts=1634141035.220700&cid=C01GTK53T8Q.
@Luke9389 according to the Video, the context menu is opening on the Preview Modal which it should not.
Oh, I see. That makes more sense. Thanks
Price increased to $500
Proposal
We can wrap the PDF component with a component that prevents the press event from going up in the tree. The press event that bubbles up ends up opening the context menu.
TouchableWithoutFeedback is a good option because it works for catching the event and doing nothing with it, and it doesn't give any visual feedback.
We can wrap the following lines:
https://github.com/Expensify/App/blob/d7a77751fe4e4563094e8650972beb59ad71d27d/src/components/PDFView/index.native.js#L34-L41
like this:
const PDFView = props => (
<View style={[styles.flex1, props.style]}>
<TouchableWithoutFeedback>
<PDF
activityIndicator={<FullScreenLoadingIndicator />}
source={{uri: props.sourceURL}}
style={[
styles.imageModalPDF,
getWidthAndHeightStyle(props.windowWidth, props.windowHeight),
]}
/>
</TouchableWithoutFeedback>
</View>
);
Ok, let's give this a try @CamilaRivera. You've got the 🟢 green light 🟢 to go ahead and make a PR.
Niiice! I've hired @CamilaRivera via Upwork now.
No updates: it has an open PR.
Not overdue: PR is open.
PR merged, waiting for deploy so I can add the payment hold.
The solution for this issue has been :rocket: deployed to production :rocket: in version 1.1.16-10 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
- https://github.com/Expensify/App/pull/6169
If no regressions arise, payment will be issued on 2021-12-06. :confetti_ball:
Created a separate job in Upwork to pay out @parasharrajat 's reporting bonus.
Paid out @CamilaRivera + company offsite bonus.
Contributor paid: ✅ Contract cancelled: ✅ Upwork posting removed: ✅