fix(accordion): accordions expand when using binding (#25322)

resolves #25307
This commit is contained in:
Liam DeBeasi
2022-05-20 09:43:04 -04:00
committed by GitHub
parent 60054310af
commit 61e571e585
9 changed files with 98 additions and 13 deletions

View File

@ -211,7 +211,8 @@ export class Accordion implements ComponentInterface {
};
private expandAccordion = (initialUpdate = false) => {
if (initialUpdate) {
const { contentEl, contentElWrapper } = this;
if (initialUpdate || contentEl === undefined || contentElWrapper === undefined) {
this.state = AccordionState.Expanded;
return;
}
@ -220,11 +221,6 @@ export class Accordion implements ComponentInterface {
return;
}
const { contentEl, contentElWrapper } = this;
if (contentEl === undefined || contentElWrapper === undefined) {
return;
}
if (this.currentRaf !== undefined) {
cancelAnimationFrame(this.currentRaf);
}
@ -250,7 +246,8 @@ export class Accordion implements ComponentInterface {
};
private collapseAccordion = (initialUpdate = false) => {
if (initialUpdate) {
const { contentEl } = this;
if (initialUpdate || contentEl === undefined) {
this.state = AccordionState.Collapsed;
return;
}
@ -259,11 +256,6 @@ export class Accordion implements ComponentInterface {
return;
}
const { contentEl } = this;
if (contentEl === undefined) {
return;
}
if (this.currentRaf !== undefined) {
cancelAnimationFrame(this.currentRaf);
}