-
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
[Payment due 1-25][$250] Scan - "Drop file here" modal does not dismiss when file is no longer dragged over the area #33820
Comments
Job added to Upwork: https://www.upwork.com/jobs/~01d19df269e522389b |
Triggered auto assignment to @Christinadobrzyn ( |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt ( |
ProposalPlease re-state the problem that we are trying to solve in this issue."Drop file here" modal does not dismiss when file is no longer dragged over the area What is the root cause of that problem?The drag-and-drop hook is based on a reference counter to do the overlay works well, but when we use a component or window that lives outside the browser we get this bug because the counter increases more than expected. What changes do you think we should make in order to solve the problem?We should modify the drag-and-drop hook to take into consideration scenarios when we are dragging outside the drag-and-drop zone to decrease the reference counter. The code should be like:
Result - after changes: drag-and-drop.test.after.changes.mp4 |
ProposalPlease re-state the problem that we are trying to solve in this issue.The scan request drop view doesn't disappear after we stop the drag. What is the root cause of that problem?This can easily be reproduced when you start dragging your file to the instruction view (that is the Upload receipt text and image). Screen.Recording.2024-01-02.at.12.18.07.movThe drop file here view will be shown if App/src/components/DragAndDrop/Consumer/index.tsx Lines 7 to 18 in fe49e4f
The App/src/hooks/useDragAndDrop.ts Lines 84 to 99 in fe49e4f
The problem in this issue is, that the The reason we use drag counter is explained in the comment here. App/src/hooks/useDragAndDrop.ts Lines 33 to 37 in fe49e4f
In short, when you move from one element to another element, the ENTER (for the new element) and LEAVE (for the current element) events will be called. So, the ENTER and LEAVE events should cancel out each other. However, if the element disappears, the LEAVE event won't be called. In our case, if we start dragging the file to the instruction view, let's say the "Upload receipt" text, the ENTER event will be triggered for the "Upload receipt" text. Then, the drop file here view shows AND the instruction view disappears.
Thus, the LEAVE event for "Upload receipt" text is never fired leaving 1 drag counter behind. What changes do you think we should make in order to solve the problem?The simplest solution is to make it invisible by setting the opacity to 0 when dragging instead of unmounting it from the view.
What alternative solutions did you explore? (Optional)The other way is:
|
ProposalPlease re-state the problem that we are trying to solve in this issue."Drop file here" modal does not dismiss when the file is no longer dragged over the area What is the root cause of that problem?We're updating App/src/hooks/useDragAndDrop.ts Lines 35 to 36 in cb4fc64
We can think of this counter as a stack, so we will decrease -> isDraggingOver is not set to false What changes do you think we should make in order to solve the problem?We should not lean on
Ref: https://stackoverflow.com/a/54271161 What alternative solutions did you explore? (Optional)NA ResultScreen.Recording.2024-01-02.at.11.45.38.mov |
might be related to: #27744 I think this could be part of Wave 6. It seems like this issue only happens if you drag the file back and forth very quickly for multiple attempts - so I think this can be low priority. I think let's continue to collect proposals until we decide to pause this after the Wave 6 inclusion review |
@samilabud Thanks for the proposal. Unfortunately I don't think your RCA is valid. |
@bernhardoj Thanks for the proposal. Your RCA is about right. However the solution is a workaround since we are not fixing the root cause and it may only fix one particular case (same goes with the alternative solution). |
@tienifr Thanks for the proposal. Your RCA is about right as well (the reason on why the leave event is not being fired may be related to more than the fact that the element is removed from the dom - not a blocker). Your suggested solution makes sense to me. If we are dragging(moving) out of an element to another element that is still within the drop zone then the dragging is effectively not over. 🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @tgolen, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
📣 @s77rt 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @tienifr 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
Seems like regression came from this issue |
|
@Christinadobrzyn Can you please add the |
@Christinadobrzyn Ah sorry for not clarifying. This should be paid on 25th. The payment due here should be $250. (No work is being done on any PR. All is done already) |
Upwork job price has been updated to $250 |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 1.4.20-2
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: Applause - Internal Team
Slack conversation:
Action Performed:
Expected Result:
"Drop file here" modal will dimiss when the file is no longer dragged over the area
Actual Result:
"Drop file here" modal does not dismiss when the file is no longer dragged over the area
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6329833_1704112789223.bandicam_2023-12-30_11-57-55-618.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: