Repository navigation
Description
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.3.87-1
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation:
Action Performed:
- Open the app
- Open any distance request report or raise one and open
- Click on image
- Click on 3 dots and click on delete request
- When delete confirmation popup is open, press ESC
- Observe that image below closes first and delete confirmation popup closes after it
Expected Result:
App should either only close delete confirmation popup on ESC or app should close first delete confirmation popup and then close the image on ESC
Actual Result:
App closes the image below first and then closes delete confirmation popup on ESC
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
- Android: Native
- Android: mWeb Chrome
- iOS: Native
- iOS: mWeb Safari
- MacOS: Chrome / Safari
- MacOS: Desktop
Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
mac.chrome.delete.popup.closes.after.image.mov
Recording.129.mp4
MacOS: Desktop
mac.desktop.delete.popup.closes.after.image.mov
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~015397445ef3d88685
- Upwork Job ID: 1715188446668767232
- Last Price Increase: 2023-11-03
- Automatic offers:
- hoangzinh | Reviewer | 27607852
- dukenv0307 | Contributor | 27607853
- dhanashree-sawant | Reporter | 27607855
Activity
[-]Delete request popup closes after map image popup on ESC[/-][+][$500] Delete request popup closes after map image popup on ESC[/+]melvin-bot commentedon Oct 20, 2023
Triggered auto assignment to @MitchExpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Oct 20, 2023
Job added to Upwork: https://www.upwork.com/jobs/~015397445ef3d88685
melvin-bot commentedon Oct 20, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Oct 20, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh (
External)abzokhattab commentedon Oct 20, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Confirmation dialog closes after the attachment modal on pressing ESC
What is the root cause of that problem?
we dont close the delete confirm dialog before the attachment modal is closed:
first of all when we click on
ESCit triggers theonClosefunction:App/src/components/Modal/BaseModal.js
Lines 180 to 182 in fd015a0
the
onClosefunction itself doesnt close the confirmation dialog first before the closing the main modal:App/src/components/AttachmentModal.js
Lines 335 to 343 in 5ad3372
thats why the confirmation dialog closes after the main modal
What changes do you think we should make in order to solve the problem?
modify the
onClosefunction to close the confirmation before closing the main modal:Alternative Solution:
instead of changing the closeModal logic, we can use UseEffect that would update the visiblity of the confirm dialog if the modal is not open:
eh2077 commentedon Oct 20, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Delete request popup closes after map image popup on ESC
What is the root cause of that problem?
The root cause of this issue is that, when pressing ESC keyboard shortcut, the Modal update order is
ESCkeydown event first to callModal.onBackButtonPressand then calle.stopImmediatePropagation();So, the two modals are closed by a single
ESCkeydown.What changes do you think we should make in order to solve the problem?
To fix this issue, we can pass
onBackButtonPressto Modalafter this line
App/src/components/AttachmentModal.js
Line 401 in f9cf18e
And in
BaseModal.js, we changeApp/src/components/Modal/BaseModal.js
Line 182 in f9cf18e
to
What alternative solutions did you explore? (Optional)
N/A
dukenv0307 commentedon Oct 20, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
I think the OP expected is not entirely correct. When we're opening the delete modal, the modal in focus here is the "Delete modal", not the "Attachment modal", and we can also see there's no way for the user to click on the X button to close the AttachmentModal since there's an overlay and we don't want the user to interact with the AttachmentModal. So the keyboard shortcut should behave the same, the ESC keypress should close the delete modal only, if the user next wants to close the AttachmentModal, they can press ESC again. This is aligned with how the user naturally navigates the app and the keyboard shortcuts should mirror what the user will actually do.
What is the root cause of that problem?
When we press ESC the
onCloseof the AttachmentModal here will be triggered, which closes the attachment modal. And later on once the attachment modal is hidden, the content of it will be unmounted, and the delete modal will disappear because it's in the content of the attachment modal.What changes do you think we should make in order to solve the problem?
Update this line so that if the attachment modal is overlayed by the confirm modal, it will not listen to ESC keypress and the confirm modal will have the preference for listening to the ESC.
We can modify the
BaseModala bit to be safe when calling thecloseModal(becausecloseModalcould be falsy now).What alternative solutions did you explore? (Optional)
We can pass
undefinedas thecloseModalin the above case and makecloseModalan optional prop ofBaseModal. It's better to make it optional since if we don't allow the modal to be closed (like when it's overlayed), we don't want to registeronClosesince it might override other modals on top.melvin-bot commentedon Oct 20, 2023
📣 @nimishdubey2! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Format:
46 remaining items
[-][$500] Delete request popup closes after map image popup on ESC[/-][+][HOLD for payment 2023-12-06] [$500] Delete request popup closes after map image popup on ESC[/+]melvin-bot commentedon Nov 29, 2023
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Nov 29, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.4-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-12-06. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Nov 29, 2023
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
MitchExpensify commentedon Dec 4, 2023
Payment summary:
hoangzinh commentedon Dec 5, 2023
BugZero Checklist:
MitchExpensify commentedon Dec 7, 2023
All paid!