Skip to content

bug: ion-accordion plays animation on initial state update when using Angular property binding #30613

Closed

Description

@ReneZeidler

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

When setting an ion-accordion to be initially open by using [value]='...' on the ion-accordion-group, the accordion is first rendered closed and then animates open.

Expected Behavior

The initial state when the accordion first loads should not play an animation.

Steps to Reproduce

  1. Go to the code reproduction URL
  2. Click the reload button in the Stackblitz browser preview
  3. Observe that the accordions in the first two columns play an animation (they use [value]="..."), while the last column doesn't (it uses value="..."). In all cases the actual value is constant.

Code Reproduction URL

https://stackblitz.com/edit/ion-accordion-initial-animation-bug?file=src%2Fapp%2Fexample.component.html

Ionic Info

Ionic:

Ionic CLI : 7.2.1
Ionic Framework : @ionic/angular 8.7.2
@angular-devkit/build-angular : 20.1.5
@angular-devkit/schematics : 20.1.5
@angular/cli : 20.1.5
@ionic/angular-toolkit : 12.2.0

Utility:

cordova-res : not installed globally
native-run : not installed globally

System:

NodeJS : v20.19.1 (/usr/local/bin/node)
npm : 10.8.2
OS : Linux 5.0

Additional Information

The issue is a regression since v8.6.0. The issue didn't occur with v8.5.9.

The issue #28506 was similar and the cause for this issue might be related to component initialization order. The initial values for Angular inputs are sometimes set after the Stencil component has fully initialized.
Issue #30552 was also a timing issue (but using React instead of Angular) where a property of ion-tab was not set in time for the first render. This was also introduced in v8.6.0.

I suspect the Stencil update from 4.20.0 to 4.29.3 (#30132) changed something about the timings on component initialization.

Activity

  1. added
    type: bug
    package: core
    on Aug 7, 2025
  2. aeharding commented on Oct 15, 2025

    @aeharding
    Contributor

    FWIW, this isn't an Angular-specific issue, it also happens in React. It can be seen on the stock accordion example here:

    https://stackblitz.com/edit/dbaxphvw?file=src%2FApp.tsx

    Just refresh the preview to see it animate, when it shouldn't.

  3. ShaneK commented on Oct 16, 2025

    @ShaneK
    Member

    Hey! Thanks for the report!

    This issue was caused by a change to Stencil that corrected the order in which components with children rendered and triggered their lifecycle hooks. I have a PR up that I believe will address this issue in Ionic Framework.

    If you would like to test the solution PR, the current dev build is:

    8.7.8-dev.11760617852.1761d06f
    
  4. added a commit that references this issue on Nov 3, 2025
    58d5638
  5. ShaneK commented on Nov 5, 2025

    @ShaneK
    Member

    Hey! The fix for this has been released in v8.7.9

  6. ionitron-bot commented on Dec 5, 2025

    @ionitron-bot

    Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

  7. locked and limited conversation to collaborators on Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: coretype: bug

    Type

    Fields

    Stage

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions