Skip to content

Commit

Permalink
Revert "primefaces#14223 fix for regression value can be '' or null"
Browse files Browse the repository at this point in the history
This reverts commit fa44251.
  • Loading branch information
pete-mcwilliams committed Nov 28, 2023
1 parent fa44251 commit 79640af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV
}

get isVisibleClearIcon(): boolean | undefined {
return this.modelValue() != null && this.hasSelectedOption() && this.showClear && !this.disabled;
return this.modelValue() != null && ObjectUtils.isNotEmpty(this.modelValue()) && this.modelValue() !== '' && this.showClear && !this.disabled;
}

get containerClass() {
Expand Down Expand Up @@ -1459,7 +1459,7 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV
}

hasSelectedOption() {
return this.modelValue() !== undefined;
return ObjectUtils.isNotEmpty(this.modelValue());
}

isValidSelectedOption(option) {
Expand Down

0 comments on commit 79640af

Please sign in to comment.