primefaces / primeng

The Most Complete Angular UI Component Library
https://primeng.org
Other
10.62k stars 4.63k forks source link

FloatLabel/Select: Issues when select value is string, then float label is over the Value #16856

Open NiBurhe opened 4 days ago

NiBurhe commented 4 days ago

Describe the bug

When you have a float-label and a select. The select has options with value as string, then the float label is not on

image

` <p-select id="inputId" optionLabel="label" optionValue="value" [formControl]="control" [fluid]="true" [options]="options" />

`

control = new FormControl<string>('b') options = [{label: 'a', value: 'a'}, {label: 'b', value: 'b'}]

When the value is a number it works fine

Environment

Angular 18

Reproducer

https://github.com/NiBurhe/primeng-issue-template/tree/NiBurhe/public/src

Angular version

18.2.9

PrimeNG version

18.0.0-rc.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

20.18.0

Browser(s)

Chrome 130.0.6723.117

Steps to reproduce the behavior

As long you have the focus everything is fine, but when the focus is gone, then the label is over the value again.

Expected behavior

Label always on the select, when a value is selected

RichardMcElroy commented 2 days ago

I've also got this with the default variant 'over' when the value of options is a string