Skip to content

[tabs] keepMounted={false} doesn't mount children but still mounts the root element #1872

Open
@ImSingee

Description

@ImSingee

Bug report

Current behavior

The whole dom for non-active tab panel shouldn't exist when keepMounted is false (or is omitted).

But the dom still exists for non-active tab.

Image

Expected behavior

The last two dom nodes from the previous screenshot shouldn't exist.

Reproducible example

Your doc site https://base-ui.com/react/components/tabs

Or its CodeSandbox https://codesandbox.io/s/gzrqk5?file=src/App.tsx

Base UI version

1.0.0-alpha.8

Which browser are you using?

Chrome 135.0.3179.98 (Official build) (arm64)

Which OS are you using?

macOS

Which assistive tech are you using (if applicable)?

N/A

Additional context

The related component: https://base-ui.com/react/components/tabs#panel

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions