diff --git a/src/components/dropdown/Dropdown.vue b/src/components/dropdown/Dropdown.vue index d1d2bfca8..d1b4b6074 100755 --- a/src/components/dropdown/Dropdown.vue +++ b/src/components/dropdown/Dropdown.vue @@ -584,6 +584,7 @@ export default { this.unbindOutsideClickListener(); this.unbindScrollListener(); this.unbindResizeListener(); + this.$emit('hide'); this.overlay = null; }, @@ -849,7 +850,7 @@ export default { return this.emptySelectionMessage || this.$primevue.config.locale.emptySelectionMessage; }, selectedMessageText() { - return ObjectUtils.isNotEmpty(this.modelValue) ? this.selectionMessageText.replaceAll('{0}', '1') : this.emptySelectionMessageText; + return this.hasSelectedOption ? this.selectionMessageText.replaceAll('{0}', '1') : this.emptySelectionMessageText; }, focusedOptionId() { return this.focusedOptionIndex !== -1 ? `${this.id}_${this.focusedOptionIndex}` : null; diff --git a/src/components/listbox/Listbox.vue b/src/components/listbox/Listbox.vue index 7b96e95b1..186015a39 100755 --- a/src/components/listbox/Listbox.vue +++ b/src/components/listbox/Listbox.vue @@ -680,7 +680,7 @@ export default { return this.emptySelectionMessage || this.$primevue.config.locale.emptySelectionMessage; }, selectedMessageText() { - return ObjectUtils.isNotEmpty(this.modelValue) ? this.selectionMessageText.replaceAll('{0}', this.multiple ? this.modelValue.length : '1') : this.emptySelectionMessageText; + return this.hasSelectedOption ? this.selectionMessageText.replaceAll('{0}', this.multiple ? this.modelValue.length : '1') : this.emptySelectionMessageText; }, focusedOptionId() { return this.focusedOptionIndex !== -1 ? `${this.id}_${this.focusedOptionIndex}` : null; diff --git a/src/components/multiselect/MultiSelect.vue b/src/components/multiselect/MultiSelect.vue index 3d1fde4f8..eef3e5b77 100755 --- a/src/components/multiselect/MultiSelect.vue +++ b/src/components/multiselect/MultiSelect.vue @@ -674,6 +674,7 @@ export default { this.unbindOutsideClickListener(); this.unbindScrollListener(); this.unbindResizeListener(); + this.$emit('hide'); this.overlay = null; }, @@ -1011,7 +1012,7 @@ export default { return this.emptySelectionMessage || this.$primevue.config.locale.emptySelectionMessage; }, selectedMessageText() { - return ObjectUtils.isNotEmpty(this.modelValue) ? this.selectionMessageText.replaceAll('{0}', this.modelValue.length) : this.emptySelectionMessageText; + return this.hasSelectedOption ? this.selectionMessageText.replaceAll('{0}', this.modelValue.length) : this.emptySelectionMessageText; }, focusedOptionId() { return this.focusedOptionIndex !== -1 ? `${this.id}_${this.focusedOptionIndex}` : null;