-
Notifications
You must be signed in to change notification settings - Fork 13.4k
fix(accordion-group): skip initial animation #30729
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@ShaneK Thanks for fixing this! It looks great in the main react use examples, but I did find the following case where it doesn't animate initially. It used to work before but maybe I'm not doing things right I just wanted to let you know :P https://stackblitz.com/edit/dbaxphvw-jt3durvs?file=src%2Fmain.tsx |
Excellent catch, new dev build should address this.
|
Thanks works great! |
const firstAccordion = accordionGroup.querySelector('ion-accordion[value="first"]')!; | ||
|
||
expect(firstAccordion.classList.contains('accordion-expanded')).toEqual(true); | ||
expect(firstAccordion.classList.contains('accordion-expanding')).toEqual(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't realize that spec tests capture these kinds of classes. I would have expected it to be false all the time since expect
would run after the animation ended. I'll have to keep this in mind for future tests. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still seeing the arrows animate in the React app. Angular app is working well with the dev build, no animation on the accordions including the arrows.
Okay, I think I've got it! New dev build:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, minor request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Issue number: resolves #30613
What is the current behavior?
Currently, when you load an accordion group, the initially selected accordion animates open. This is an unexpected change caused by upgrading Stencil to >= 4.21.0, which changed the way component lifecycles got triggered.
What is the new behavior?
With this change, we're waiting for the accordion in the accordion group to render and telling it if the update it's going through is the initial update or not. This allows it to decide to animate properly.
Does this introduce a breaking change?
Other information
Current dev build: