From c656b4ea59f4c46ec5ecaafbf3ff1cb03de0828f Mon Sep 17 00:00:00 2001 From: Enrico Messall Date: Fri, 3 Nov 2023 22:38:11 +0100 Subject: [PATCH] Fixed #14007 - Dropdown empty label error --- src/app/components/dropdown/dropdown.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/components/dropdown/dropdown.ts b/src/app/components/dropdown/dropdown.ts index 484b7b7a24e..072f0b26f21 100755 --- a/src/app/components/dropdown/dropdown.ts +++ b/src/app/components/dropdown/dropdown.ts @@ -859,10 +859,11 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV } get inputClass() { + const label = this.label(); return { 'p-dropdown-label p-inputtext': true, - 'p-placeholder': this.placeholder && this.label() === this.placeholder, - 'p-dropdown-label-empty': !this.editable && !this.selectedItemTemplate && (this.label() === 'p-emptylabel' || this.label().length === 0) + 'p-placeholder': this.placeholder && label === this.placeholder, + 'p-dropdown-label-empty': !this.editable && !this.selectedItemTemplate && (!label || label === 'p-emptylabel' || label.length === 0) }; }