From fa44251a3cc0198790ce9d740521930ab1f27dc8 Mon Sep 17 00:00:00 2001 From: pete-mcwilliams Date: Tue, 28 Nov 2023 11:11:24 +0000 Subject: [PATCH] #14223 fix for regression value can be '' or null --- src/app/components/dropdown/dropdown.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/components/dropdown/dropdown.ts b/src/app/components/dropdown/dropdown.ts index ecd1b1780ff..fba49d9bbd3 100755 --- a/src/app/components/dropdown/dropdown.ts +++ b/src/app/components/dropdown/dropdown.ts @@ -858,7 +858,7 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV } get isVisibleClearIcon(): boolean | undefined { - return this.modelValue() != null && ObjectUtils.isNotEmpty(this.modelValue()) && this.modelValue() !== '' && this.showClear && !this.disabled; + return this.modelValue() != null && this.hasSelectedOption() && this.showClear && !this.disabled; } get containerClass() { @@ -1459,7 +1459,7 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV } hasSelectedOption() { - return ObjectUtils.isNotEmpty(this.modelValue()); + return this.modelValue() !== undefined; } isValidSelectedOption(option) {