From 821852e9d7b04fdba6fa226b0740aba9ee5ea28e Mon Sep 17 00:00:00 2001 From: Matthew DuCharme Date: Fri, 18 Jun 2021 22:26:41 -0400 Subject: [PATCH 1/2] Fixed state not being reset to correct value when transitioning out --- addon/components/basic-dropdown-content.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addon/components/basic-dropdown-content.ts b/addon/components/basic-dropdown-content.ts index 4f747592..b864e837 100644 --- a/addon/components/basic-dropdown-content.ts +++ b/addon/components/basic-dropdown-content.ts @@ -125,6 +125,7 @@ export default class BasicDropdownContent extends Component { @action animateOut(dropdownElement: Element): void { if (!this.animationEnabled) return; + this.animationClass = this.transitioningInClass; let parentElement = dropdownElement.parentElement; if (parentElement === null) return; if (this.args.renderInPlace) { @@ -136,7 +137,6 @@ export default class BasicDropdownContent extends Component { clone.classList.remove(...this.transitioningInClass.split(' ')); clone.classList.add(...this.transitioningOutClass.split(' ')); parentElement.appendChild(clone); - this.animationClass = this.transitionedInClass; waitForAnimations(clone, function() { (parentElement as HTMLElement).removeChild(clone); }); From fd99d8d84f499638f7c5e9932be47a0408fbe254 Mon Sep 17 00:00:00 2001 From: ducharmemp Date: Sun, 27 Jun 2021 11:33:20 -0400 Subject: [PATCH 2/2] Updating parent element to be destination element --- addon/components/basic-dropdown-content.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/addon/components/basic-dropdown-content.ts b/addon/components/basic-dropdown-content.ts index b864e837..a85e045a 100644 --- a/addon/components/basic-dropdown-content.ts +++ b/addon/components/basic-dropdown-content.ts @@ -126,11 +126,7 @@ export default class BasicDropdownContent extends Component { animateOut(dropdownElement: Element): void { if (!this.animationEnabled) return; this.animationClass = this.transitioningInClass; - let parentElement = dropdownElement.parentElement; - if (parentElement === null) return; - if (this.args.renderInPlace) { - parentElement = parentElement.parentElement - } + let parentElement = this.destinationElement; if (parentElement === null) return; let clone = dropdownElement.cloneNode(true) as Element; clone.id = `${clone.id}--clone`;