fix: Pressing Esc closes fullscreen video instead of 3 dot menu#92167
fix: Pressing Esc closes fullscreen video instead of 3 dot menu#92167TaduJR wants to merge 7 commits into
Conversation
|
@linhvovan29546 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0c4c289c9f
ℹ️ 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".
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 39f3ec11d5
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
Reviewing... |
|
@TaduJR The eslint failed |
|
Bug: Pressing Esc closes both the attachment modal and the RHP. Screen.Recording.2026-06-04.at.21.39.59.mov |
Explanation of Change
When the video lightbox is open and you press Esc with the 3-dot menu open, both
AttachmentModalBaseContent'suseKeyboardShortcut(ESCAPE, onClose)andReanimatedModal'skeyup-Escape listener ondocument.bodyfire before the popover can react. The lightbox closes instead of the menu.PopoverMenudoesn't claim Escape — it just relies on its inner modal's keyup listener, which races and loses. This PR makes both v1 (PopoverMenu/index.tsx) and v2 (PopoverMenu/v2) claim Escape while open:useKeyboardShortcut(ESCAPE, …, { isActive: isVisible, shouldBubble: false })— new subscriptions splice at index 0 so ours runs first;shouldBubble: falsestops the rest of the shortcut stacksuppressNextEscapeKeyUp()— singleton one-shot capture-phase listener ondocumentthat swallows the matching keyup soReanimatedModal's body-level keyup handler can't dismiss the parent on the same keystroke. Singleton becausePopoverProvider's earlier document-capture keyup canstopImmediatePropagationbefore ours runs — each install evicts any pending listener so leaks can't accumulate. (web only; no-op on native)v2 packages this as a
useCloseOnEscapelifecycle hook alongside the existinguseCloseOnScreenBlur/useCloseOnModalCoverinuseContentController. v1 gets the same call inline next to the existing ENTER/SPACE shortcuts, routed through a singlehandleCloseso submenu state (currentMenuItems/enteredSubMenuIndexes) resets on every close path.Per design: Esc closes the whole popover, including from inside a
<Sub>— no "back one level" semantics.Fixed Issues
$ #91146
PROPOSAL:
Tests
Offline tests
Same as tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
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
Screen.Recording.2026-06-01.at.10.03.45.AM.mov