FIX: makes sure mousedown is stopped only on select-kit element

This commit is contained in:
Joffrey JAFFEUX 2018-01-19 15:19:07 +01:00 committed by GitHub
parent d24c35012d
commit bd5a82cfe7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 6 deletions

View File

@ -38,14 +38,19 @@ export default Ember.Mixin.create({
$(document)
.on("mousedown.select-kit", event => {
event.stopPropagation();
if (!this.element || this.isDestroying || this.isDestroyed) {
return true;
}
if (!this.get("renderedBodyOnce")) return;
if (!this.get("isFocused")) return;
if (Ember.isNone(this.get("element"))) return;
if (Ember.$.contains(this.get("element"), event.target)) return;
if (Ember.$.contains(this.element, event.target)) {
event.stopPropagation();
if (!this.get("renderedBodyOnce")) return;
if (!this.get("isFocused")) return;
} else {
this.didClickOutside(event);
}
this.didClickOutside(event);
return true;
});
this.$header()