diff --git a/src/components/multiselect/MultiSelect.vue b/src/components/multiselect/MultiSelect.vue index d2f10800a..4c9005543 100644 --- a/src/components/multiselect/MultiSelect.vue +++ b/src/components/multiselect/MultiSelect.vue @@ -251,7 +251,7 @@ export default { bindOutsideClickListener() { if (!this.outsideClickListener) { this.outsideClickListener = (event) => { - if (this.overlayVisible && this.$refs.overlay && !this.$refs.overlay.contains(event.target)) { + if (this.overlayVisible && this.isOutsideClicked(event)) { this.overlayVisible = false; } }; @@ -264,6 +264,9 @@ export default { 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) { let label = null;