Skip to content

Commit

Permalink
Updating parent element to be destination element
Browse files Browse the repository at this point in the history
  • Loading branch information
ducharmemp committed Jun 27, 2021
1 parent 821852e commit f5ba32e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions addon/components/basic-dropdown-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,7 @@ export default class BasicDropdownContent extends Component<Args> {
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`;
Expand Down
2 changes: 1 addition & 1 deletion addon/templates/components/basic-dropdown-content.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{! template-lint-disable no-inline-styles }}
{{#if @dropdown.isOpen}}
<div class="ember-basic-dropdown-content-wormhole-origin">
<div class={{if @dropdown.isOpen "ember-basic-dropdown-content-wormhole-origin" "ember-basic-dropdown-content-placeholder"}}>
{{#maybe-in-element this.destinationElement @renderInPlace}}
{{#if @overlay}}
<div class="ember-basic-dropdown-overlay"></div>
Expand Down

0 comments on commit f5ba32e

Please sign in to comment.