Skip to content

Portal the overlay outlet and keep the shared backdrop through close delay - #9

Merged
mauroerta merged 2 commits into
mainfrom
feat/portal-shared-backdrop
Sep 13, 2026
Merged

mauroerta merged 2 commits into
mainfrom
feat/portal-shared-backdrop

Conversation

@mauroerta

Copy link
Copy Markdown
Member

Summary

  • OverlayProvider portals the shared backdrop and overlay instances to document.body, or to a container.
  • The shared backdrop receives open and stays mounted through close delay, so the dim can fade with the last overlay instance.
  • An overlay definition can replace that dim or pass { backdrop: false } so a lower instance keeps it.
  • Unmounting the outlet provider settles pending openAsync() as undefined and clears the stack.
  • The shadcn adapter uses an opacity transition. Copying DialogOverlay's animate-out keyframes snaps the dim back in, because Cue still holds the node until delay ends.

Test plan

  • Open the docs landing dialog and dismiss it. The dim fades once and does not pop back.
  • Stack two overlays, close the top one, confirm the dim stays.
  • Open a backdrop: false overlay over a dialog. The dialog dim stays. Open that overlay alone. There is no dim.
  • Unmount OverlayProvider while openAsync() is pending. The promise resolves undefined.
  • Mount a second OverlayProvider for the same Cue. It renders children only.

Made with Cursor

…delay.

Headless overlays clipped in-flow, and the docs dim flickered on dismiss because animate-out snaps back while Cue still holds the node.

Co-authored-by: Cursor <cursoragent@cursor.com>
@changeset-bot

changeset-bot Bot commented Sep 13, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 56f0d22

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@vlkoss/cue Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Co-authored-by: Cursor <cursoragent@cursor.com>
@mauroerta
mauroerta merged commit 4ef1fb8 into main Sep 13, 2026
1 check passed
@mauroerta
mauroerta deleted the feat/portal-shared-backdrop branch September 13, 2026 16:33
@github-actions github-actions Bot mentioned this pull request Sep 13, 2026
mauroerta pushed a commit that referenced this pull request Sep 13, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @vlkoss/cue@1.1.0

### Minor Changes

- [#9](#9)
[`4ef1fb8`](4ef1fb8)
Thanks [@mauroerta](https://github.com/mauroerta)! - Portal the overlay
outlet, follow close delay on the shared backdrop, and let overlay
definitions opt out of or replace that dim.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant