Skip to content

[Accordion] Panel exit animation is sometimes skipped #3099

@joncoronel

Description

@joncoronel

Bug report

Current behavior

Panel exit animations sometimes get interrupted due to display: none being applied prematurely to the panel that is going from opened state to close state. Specifically when multiple={false} and transitioning from one opened panel to another panel being opened. This causes the height animation to be skipped so there's a sudden layout shift. Hard to debug since it's very inconsistent. It seems to occur more often the more complex the content in the panel is.

FocuSee.Project.2025-10-29.22-42-44.mp4

In the video, when the top most trigger is clicked, the previously opened panel immediately is hidden instead of transitioning out.

Expected behavior

When alternating opened panels, the previously opened panel's height should transition it's height to 0 while the newly opened panel should simultaneously transition it's height to the content of the panel.

Reproducible example

CodeSandbox

Might require opening different accordion panels for a bit for the issue to occur.

The video taken was of this example. I duplicated the select component in the panel as it seems to make the issue occur more often.

Here is a minimal repo as well with essentially the same code and issue: https://github.com/joncoronel/base-ui-accordion-bug

Base UI version

1.0.0-beta.4

Which browser are you using?

Chrome. Does not occur in Firefox.

Which OS are you using?

Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: accordionChanges related to the accordion component.type: bugIt doesn't behave as expected.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions