[drawer] Respect canceled snap point dismissal - #5571
Merged
atomiks merged 3 commits intoAug 26, 2026
Conversation
radist2s
requested review from
atomiks,
colmtuite,
flaviendelangle,
jjenzz and
michaldudak
as code owners
August 25, 2026 23:38
commit: |
Bundle size
PerformanceTotal duration: 1,194.87 ms -16.93 ms(-1.4%) | Renders: 76 (+0) | Paint: 1,925.91 ms -57.76 ms(-2.9%)
14 tests within noise — details Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
Author
|
@atomiks, thank you so much for your prompt response! You’re brilliant, guys! |
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 #5570
With
snapPoints, a swipe dismissal first proposesnullthroughonSnapPointChange. Consumers can cancel this change, butcloseFromSnapPointscurrently continues into the swipe release even when the event details are canceled.This temporarily applies the popup's exit state and can request
onOpenChange(false). When a controlled consumer rejects that close as well, the popup fades out before being restored to its previous snap point.Reproduction
Both examples use the same controlled Drawer scenario and the same Base UI preview packages. The fixed example applies this change through a Yarn patch.
Steps:
Before:
The popup can briefly fade out before returning.
After:
The canceled dismissal settles immediately without entering the exit state.
Changes
Check
snapPointEventDetails.isCanceledimmediately after proposing thenullsnap point.Reset swipe progress and clear the release state when the proposal is canceled.
Return before storing a pending close snap point or starting the swipe release.
Add a regression test that verifies
onOpenChangeis not called and that neitherdata-ending-stylenordata-swipe-dismissis applied, including transient attribute changes.I have followed (at least) the PR section of the contributing guide.