Fix - Scan request page active drop zone UI keeps showing#85589
Fix - Scan request page active drop zone UI keeps showing#85589FitseTLT wants to merge 2 commits intoExpensify:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6c18ea1183
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| case DRAG_LEAVE_EVENT: | ||
| dragCounter.current -= 1; | ||
| if (dragCounter.current <= 0) { | ||
| dragCounter.current = 0; | ||
| // Add small debounce to prevent rapid flickering | ||
| debounceTimeoutRef.current = setTimeout(() => { | ||
| setIsDraggingOver(false); | ||
| }, 50); | ||
| } | ||
| // Add small debounce to prevent rapid flickering | ||
| debounceTimeoutRef.current = setTimeout(() => { | ||
| setIsDraggingOver(false); | ||
| }, 50); |
There was a problem hiding this comment.
Keep active drop state until pointer leaves drop zone
This now clears isDraggingOver on every dragleave, but dragleave is also fired when moving between child elements inside the same drop zone. In that case the 50ms timer can flip the UI to inactive even though the file is still over the drop target, and dragover does not set it back to true (only dragenter does), so the highlight can disappear while still hovering. The removed counter previously guarded against these nested enter/leave transitions.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Looking good. @FitseTLT what do you think of this comment? Thank you.
There was a problem hiding this comment.
dragleave is not fired when moving between child elements inside the same drop zone. And even if it did the previous guard wasn't functional at all as it would set the state to false on multiple dragleave events.
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-03-18.at.12.29.35.mov |
|
@brunovjk But I see a new related bug that is also reproducible on staging. Should we broaden the scope of the pr and fix it? As you can see the dual drop zone ( attachment / receipt) doesn't make the attachment drop zone active on first drag enter(Note the active zone has a broken line highlight) 2026-03-18.20-04-32.mp4 |
Explanation of Change
Fixed Issues
$ #85135
PROPOSAL: #85135 (comment)
Tests
Offline tests
same as tests
QA Steps
same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
2026-03-17.22-51-36.mp4