Skip to content

Commit

Permalink
Refactor on #14719
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Feb 7, 2024
1 parent b8cdb86 commit 3ae9175
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV
return {
'p-dropdown-label p-inputtext': true,
'p-placeholder': this.placeholder() && label === this.placeholder(),
'p-dropdown-label-empty': !this.editable && !this.selectedItemTemplate && (!label || label === 'p-emptylabel' || label.length === 0)
'p-dropdown-label-empty': !this.editable && !this.selectedItemTemplate && (label === undefined || label === null || label === 'p-emptylabel' || label.length === 0)
};
}

Expand Down Expand Up @@ -939,6 +939,7 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV

label = computed(() => {
const selectedOptionIndex = this.findSelectedOptionIndex();

return selectedOptionIndex !== -1 ? this.getOptionLabel(this.visibleOptions()[selectedOptionIndex]) : this.placeholder() || 'p-emptylabel';
});

Expand Down Expand Up @@ -1779,7 +1780,7 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV
this.onFilter.emit({ originalEvent: event, filter: this._filterValue() });
!this.virtualScrollerDisabled && this.scroller.scrollToIndex(0);
setTimeout(() => {
this.overlayViewChild.alignOverlay()
this.overlayViewChild.alignOverlay();
});
this.cd.markForCheck();
}
Expand Down

0 comments on commit 3ae9175

Please sign in to comment.