FIX: Add check for if element doesnt exist on ensureDropClosed (#13256)

This commit is contained in:
Jordan Vidrine 2021-06-02 13:44:21 -05:00 committed by GitHub
parent 3bb765ac92
commit 188ac1c51f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -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);
}
@ -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;
});
});