Fixed #7 - Refactor on multiSelect
parent
57b5d60274
commit
beafc5a03f
|
@ -251,7 +251,7 @@ export default {
|
||||||
bindOutsideClickListener() {
|
bindOutsideClickListener() {
|
||||||
if (!this.outsideClickListener) {
|
if (!this.outsideClickListener) {
|
||||||
this.outsideClickListener = (event) => {
|
this.outsideClickListener = (event) => {
|
||||||
if (this.overlayVisible && this.$refs.overlay && !this.$refs.overlay.contains(event.target)) {
|
if (this.overlayVisible && this.isOutsideClicked(event)) {
|
||||||
this.overlayVisible = false;
|
this.overlayVisible = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -264,6 +264,9 @@ export default {
|
||||||
this.outsideClickListener = null;
|
this.outsideClickListener = null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
isOutsideClicked(event) {
|
||||||
|
return !(this.$refs.container.isSameNode(event.target) || this.$refs.container.contains(event.target) || (this.$refs.overlay && this.$refs.overlay.contains(event.target)));
|
||||||
|
},
|
||||||
getLabelByValue(val) {
|
getLabelByValue(val) {
|
||||||
let label = null;
|
let label = null;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue