Skip to content

fix(slot): Render nothing when no outlet is registered#112568

Merged
JonasBa merged 1 commit intojb/cmdk/jsx-pocfrom
jb/fix/slot-outlet-null
Apr 9, 2026
Merged

fix(slot): Render nothing when no outlet is registered#112568
JonasBa merged 1 commit intojb/cmdk/jsx-pocfrom
jb/fix/slot-outlet-null

Conversation

@JonasBa
Copy link
Copy Markdown
Member

@JonasBa JonasBa commented Apr 9, 2026

Render slot consumer content only after an outlet element is available.

Previously the slot consumer rendered its children in place until the outlet mounted, then switched over to a portal. That caused a flash of content at the wrong DOM position and changed the rendered element type under React, which reset component identity across outlet lifecycle changes.

This makes the consumer return null until the outlet is ready and updates the slot tests to match that behavior.

Refs GH-112564

Stop rendering slot consumer content in place when no outlet element is available. This avoids the initial flash at the wrong DOM position and prevents remounts caused by switching from inline rendering to a portal once the outlet appears.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 9, 2026
@JonasBa JonasBa marked this pull request as ready for review April 9, 2026 09:13
@JonasBa JonasBa requested a review from a team as a code owner April 9, 2026 09:13
@JonasBa JonasBa merged commit 7508757 into jb/cmdk/jsx-poc Apr 9, 2026
62 of 63 checks passed
@JonasBa JonasBa deleted the jb/fix/slot-outlet-null branch April 9, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants