Skip to content

[feat]: Should be able to pass keepMounted to DialogPortal #10483

@arsmth

Description

@arsmth

Feature description

It is currently not possible when using base-ui to pass the keepMounted prop to the <DialogPortal>.

My current solution and suggestion is to add the prop to the DialogContent component:

   function DialogContent({
     className,
     children,
     showCloseButton = true,
+    keepMounted = false,
     ...props
   }: DialogPrimitive.Popup.Props & {
     showCloseButton?: boolean;
+    keepMounted?: boolean;
   }) {
     return (
-      <DialogPortal keepMounted={keepMounted}>
+      <DialogPortal keepMounted={keepMounted}>
         <DialogOverlay />
         <DialogPrimitive.Popup
         // ...

Link to the relevant Base UI docs for context:
https://base-ui.com/react/components/dialog#portal

Affected component/components

Dialog

Additional Context

Additional details here...

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues and PRs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions