From 59520abe3f0c89a72cae01ce5352e760bd4e9ff1 Mon Sep 17 00:00:00 2001 From: Jonas Raoni Soares da Silva Date: Mon, 1 Jul 2019 17:32:43 +0300 Subject: [PATCH] primefaces/primevue#11 Modified the Dropdown to not ignore a falsy value (except null). --- src/components/dropdown/Dropdown.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/dropdown/Dropdown.vue b/src/components/dropdown/Dropdown.vue index 04279c34f6..3315819e78 100644 --- a/src/components/dropdown/Dropdown.vue +++ b/src/components/dropdown/Dropdown.vue @@ -87,7 +87,7 @@ export default { getSelectedOption() { let selectedOption; - if (this.value && this.options) { + if (this.value !== null && this.options) { for (let option of this.options) { if ((ObjectUtils.equals(this.value, this.getOptionValue(option), this.dataKey))) { selectedOption = option; @@ -104,7 +104,7 @@ export default { getSelectedOptionIndex() { let selectedOptionIndex = -1; - if (this.value && this.visibleOptions) { + if (this.value !== null && this.visibleOptions) { for (let i = 0; i < this.visibleOptions.length; i++) { if ((ObjectUtils.equals(this.value, this.getOptionValue(this.visibleOptions[i]), this.dataKey))) { selectedOptionIndex = i;