Skip to content

Commit

Permalink
FIX: Add check for if element doesnt exist on ensureDropClosed (#13256)
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanvidrine committed Jun 2, 2021
1 parent 3bb765a commit 188ac1c
Showing 1 changed file with 6 additions and 6 deletions.
Expand Up @@ -52,6 +52,10 @@ export default Component.extend(FilterModeMixin, {
},

ensureDropClosed() {
if (!this.element || this.isDestroying || this.isDestroyed) {
return;
}

if (this.expanded) {
this.set("expanded", false);
}
Expand All @@ -75,17 +79,13 @@ export default Component.extend(FilterModeMixin, {
this.element.querySelector(".drop").style.display = "none";

next(() => {
if (!this.element || this.isDestroying || this.isDestroyed) {
return;
}
this.set("expanded", false);
this.ensureDropClosed();
});

return true;
});

$(window).on("click.navigation-bar", () => {
this.set("expanded", false);
this.ensureDropClosed();
return true;
});
});
Expand Down

0 comments on commit 188ac1c

Please sign in to comment.