Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accordion Component Not Mounting Content as Expected #45160

Closed
1 task done
Sadik-Agani opened this issue Jan 31, 2025 · 2 comments
Closed
1 task done

Accordion Component Not Mounting Content as Expected #45160

Sadik-Agani opened this issue Jan 31, 2025 · 2 comments
Labels
component: accordion This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information

Comments

@Sadik-Agani
Copy link

Sadik-Agani commented Jan 31, 2025

Search keywords

Accordion Details, Accordion Details not mounting

Latest version

  • I have tested the latest version

Steps to reproduce

Steps:

  1. Render a list of components, each containing and
  2. Set mountOnEnter={true} and unmountOnExit={false} on
  3. Inspect the DOM before expanding any accordion— is missing

Current behavior

I am experiencing unexpected behaviour with the MUI component. According to the MUI documentation, accordion content is mounted in the DOM by default, even when collapsed, unless explicitly unmounted via unmountOnExit.

However, in my case, is not present in the DOM until its corresponding is expanded for the first time. I have explicitly set mountOnEnter={true} and unmountOnExit={false} on , but the details content does not appear in the DOM until expansion.

Expected behavior

According to the documentation, should be mounted in the DOM by default, regardless of expansion state, unless unmountOnExit is explicitly set to true. With mountOnEnter={true} and unmountOnExit={false}, the details content should always be present in the DOM.

@Sadik-Agani Sadik-Agani added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jan 31, 2025
@mj12albert mj12albert added the component: accordion This is the name of the generic UI component, not the React module! label Feb 3, 2025
@mj12albert
Copy link
Member

@Sadik-Agani Thanks for reporting this, would you mind providing a repro? You can fork this sandbox: https://codesandbox.io/p/sandbox/autumn-pond-v29s74

@mj12albert mj12albert added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 3, 2025
Copy link

Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: accordion This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information
Projects
None yet
Development

No branches or pull requests

2 participants