Skip to content

Commit

Permalink
Merge pull request #15976 from LoaderB0T/master
Browse files Browse the repository at this point in the history
fix(Dropdown): Placeholder is overwritten by float-label
  • Loading branch information
cetincakiroglu authored Jul 11, 2024
2 parents a34178c + 644e807 commit 1e6c19c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1226,6 +1226,10 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV
}

updatePlaceHolderForFloatingLabel(): void {
if(this._placeholder() !== null && this._placeholder() !== undefined) {
// We don't want to overwrite the placeholder if it's already set
return;
}
const parentElement = this.el.nativeElement.parentElement;
const isInFloatingLabel = parentElement?.classList.contains('p-float-label');
if (parentElement && isInFloatingLabel && !this.selectedOption) {
Expand Down

0 comments on commit 1e6c19c

Please sign in to comment.