diff --git a/src/components/multiselect/MultiSelect.vue b/src/components/multiselect/MultiSelect.vue index 893daeacd..0374eb51a 100644 --- a/src/components/multiselect/MultiSelect.vue +++ b/src/components/multiselect/MultiSelect.vue @@ -18,9 +18,9 @@
- +
-
+
@@ -78,6 +78,7 @@ export default { data() { return { focused: false, + headerCheckboxFocused: false, filterValue: null, overlayVisible: false }; @@ -122,6 +123,12 @@ export default { onBlur() { this.focused = false; }, + onHeaderCheckboxFocus() { + this.headerCheckboxFocused = true; + }, + onHeaderCheckboxBlur() { + this.headerCheckboxFocused = false; + }, onClick() { if (!this.$refs.overlay || !this.$refs.overlay.contains(event.target)) { this.overlayVisible = !this.overlayVisible; @@ -327,10 +334,19 @@ export default { return label; }, allSelected() { - if (this.filterValue && this.filterValue.trim().length > 0) - return this.value && this.visibleOptions && (this.value.length > 0 && this.value.length === this.visibleOptions.length); - else + if (this.filterValue && this.filterValue.trim().length > 0) { + let allSelected = true; + for (let option of this.visibleOptions) { + if (!this.isSelected(option)) { + allSelected = false; + break; + } + } + return allSelected; + } + else { return this.value && this.options && (this.value.length > 0 && this.value.length === this.options.length); + } } } }