Repository navigation
[drawer] Handle CloseWatcher close requests from the cancel event - #5770
Merged
atomiks merged 2 commits intoSep 22, 2026
Merged
Conversation
commit: |
Bundle size
PerformanceTotal duration: 1,075.54 ms -153.00 ms(-12.5%) | Renders: 76 (+0) | Paint: 1,792.68 ms -287.93 ms(-13.8%)
11 tests within noise — details Check out the code infra dashboard for more information about this PR. |
atomiks
marked this pull request as ready for review
September 21, 2026 02:37
atomiks
requested review from
colmtuite,
flaviendelangle,
jjenzz and
michaldudak
as code owners
September 21, 2026 02:37
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
atomiks
force-pushed
the
codex/drawer-close-watcher-cancellation
branch
from
September 22, 2026 02:36
0b63cf7 to
94d3fa6
Compare
atomiks
force-pushed
the
codex/drawer-close-watcher-cancellation
branch
from
September 22, 2026 02:42
94d3fa6 to
75720b6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5767
The drawer closed from the
CloseWatchercloseevent, which the browser only fires after destroying the watcher. Cancelling that close witheventDetails.cancel()left the drawer open with no watcher, so the next Android Back left the page.The close request is now handled from the watcher's
cancelevent:onOpenChange(false)runs there, and a cancelled close callspreventDefault()so the same watcher stays active. This also stops the browser from processing other watchers in the same group. The browser only lets one close request per user activation be prevented; when thecancelevent is not cancelable,eventDetails.cancel()is a no-op and the drawer closes like a native<dialog>. Controlled drawers can checkeventDetails.event.cancelableto tell the two cases apart.Tests use a stub that mirrors the browser's
cancel→ destroy →closesequence.