FIX: Add check for if element doesnt exist on ensureDropClosed (#13256)
This commit is contained in:
parent
3bb765ac92
commit
188ac1c51f
|
@ -52,6 +52,10 @@ export default Component.extend(FilterModeMixin, {
|
||||||
},
|
},
|
||||||
|
|
||||||
ensureDropClosed() {
|
ensureDropClosed() {
|
||||||
|
if (!this.element || this.isDestroying || this.isDestroyed) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.expanded) {
|
if (this.expanded) {
|
||||||
this.set("expanded", false);
|
this.set("expanded", false);
|
||||||
}
|
}
|
||||||
|
@ -75,17 +79,13 @@ export default Component.extend(FilterModeMixin, {
|
||||||
this.element.querySelector(".drop").style.display = "none";
|
this.element.querySelector(".drop").style.display = "none";
|
||||||
|
|
||||||
next(() => {
|
next(() => {
|
||||||
if (!this.element || this.isDestroying || this.isDestroyed) {
|
this.ensureDropClosed();
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.set("expanded", false);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
$(window).on("click.navigation-bar", () => {
|
$(window).on("click.navigation-bar", () => {
|
||||||
this.set("expanded", false);
|
this.ensureDropClosed();
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue