Fix/70466 - The composer loses focus after returning to Inbox from Account tab#74147
Fix/70466 - The composer loses focus after returning to Inbox from Account tab#74147jasperhuangg merged 3 commits intoExpensify:mainfrom
Conversation
|
LGTM |
| return ( | ||
| <FocusTrap | ||
| active={isActive} | ||
| active={isActive && isFocused} |
There was a problem hiding this comment.
The change to active={isActive && isFocused} introduces potential redundancy with the paused={!isFocused} prop on line 41.
According to focus-trap-react documentation, the paused prop is specifically designed to temporarily pause an active focus trap. When a trap is paused, it remains active but doesn't enforce focus trapping.
Current behavior:
active={isActive && isFocused}- Focus trap is only active when both conditions are truepaused={!isFocused}- Focus trap is paused when not focused
Concern:
When isFocused is false:
activebecomesfalse(deactivates the trap completely)pausedbecomestrue(attempts to pause the trap)
This creates semantic confusion - you're both deactivating AND pausing the trap simultaneously.
Recommendation:
Consider using just active={isActive} with paused={!isFocused} as originally designed, which properly leverages the pause functionality. If this doesn't fix the issue, there may be a deeper problem with how isActive is calculated in the useMemo (lines 17-36), particularly for the case in line 28 where isActive already depends on isFocused for TOP_TAB_SCREENS.
Can you clarify why both the active and paused props need to check isFocused?
There was a problem hiding this comment.
Resolved: Moved isFocused into the useMemo hook of isActive
Codecov Report❌ Patch coverage is
... and 368 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / Safari74147-web.mp4MacOS: Desktop74147-desktop.mp4 |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/jasperhuangg in version: 9.2.46-0 🚀
|
|
@dmkt9 PR was failed on Web by QA team with an original issue 1762478366898.composer_web.mp4 |
|
@IuliiaHerets That's strange — it's still working fine on my end. Did you follow any special steps? 2025-11-07.18-12-03.mp4 |
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.2.46-3 🚀
|




Explanation of Change
Fixed Issues
$ #70466
PROPOSAL: #70466 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
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
The issue doesn't occur
Android: mWeb Chrome
The issue doesn't occur
iOS: Native
The issue doesn't occur
iOS: mWeb Safari
The issue doesn't occur
MacOS: Chrome / Safari
mac.safari.mp4
MacOS: Desktop
mac.desktop.mp4