Skip to content

Conversation

@maxarias-io
Copy link

πŸ”— Linked issue

Resolves: #3605

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Reka UI's Teleport primitive (used by DialogPortal) conditionally renders content using:

<Teleport v-if="isMounted || forceMount">
https://github.com/unovue/reka-ui/blob/v2/packages/core/src/Teleport/Teleport.vue#L41-L48

Without forceMount: The modal content is never rendered server-side because isMounted is false and forceMount defaults to false. Users see modals "pop in" after hydration.

With forceMount: true: The content renders during SSR regardless of mount state, enabling proper server-rendered modals for use cases like query-parameter-driven modal states.

This prop was available in Reka UI's DialogPortal but was not being forwarded by Nuxt UI's Modal component.

Also even if we disable the portal, the Teleport component will not render

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 11, 2025

npm i https://pkg.pr.new/@nuxt/ui@5659

commit: 5ad0e02

@maxarias-io
Copy link
Author

woops let me check the types

@maxarias-io
Copy link
Author

I ran into an issue while testing this locally, it seems that after you close the modal the body will still have pointer-events: none;, I think that's coming from Reka UI's useBodyScrollLock but not 100% sure.

Ideas?

@benjamincanac
Copy link
Member

I'm not entirely sure the Dialog component is made for SSR, take a look at unovue/reka-ui#688 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow rendering the Modal component in SSR

2 participants