Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p-dropdown float label overlaps input when selected value is 0 #10245

Closed
MaksymShchukin opened this issue May 17, 2021 · 6 comments
Closed

p-dropdown float label overlaps input when selected value is 0 #10245

MaksymShchukin opened this issue May 17, 2021 · 6 comments
Assignees
Labels
LTS-FIXED-10.1.3 Fixed in PrimeNG LTS 10.1.3 LTS-FIXED-11.4.6 Fixed in PrimeNG LTS 11.4.6 Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@MaksymShchukin
Copy link

MaksymShchukin commented May 17, 2021

I'm submitting a ... (check one with "x")

[ x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports)
https://stackblitz.com/edit/github-cvtkcm

Current behavior
Float label overlaps with dropdown when selected value is 0 (possibly all falsy values behave this way)
https://prnt.sc/1310ep8

Expected behavior
Float label does not overlap with dropdown when selected value is 0

Minimal reproduction of the problem with instructions

  1. Install primeng .
  2. Add dropdown with float label to the page
  3. Configure dropdown options to contain item with value === 0

https://stackblitz.com/edit/github-cvtkcm

What is the motivation / use case for changing the behavior?

We have dropdowns where list of items may contain 0

Please tell us about your environment:

Windows 10, VS Code, npm

  • Angular version: 11.0.9
  • PrimeNG version: 11.4.2
  • Browser: Chrome 90, Edge, Firefox 88
  • Language: TypeScript 4.0.2
@Jonnyprof
Copy link

Yes, same here.
It doesn't put p-inputwrapper-filled class if have selected a falsy value.

'[class.p-inputwrapper-filled]': 'value',

@rafa-suagu
Copy link

@yigitfindikli do you accept PR for this bug?

@yigitfindikli yigitfindikli self-assigned this Jun 7, 2021
@yigitfindikli yigitfindikli added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Jun 7, 2021
@yigitfindikli yigitfindikli added this to the 12.0.0-Final milestone Jun 7, 2021
@rafa-suagu
Copy link

rafa-suagu commented Jun 9, 2021

@yigitfindikli do you will apply this fix to the v11 version?

@IlliaFrantsevskyi
Copy link

Hello @yigitfindikli!

We need this fix in 11 version of primeng, since we are using Angular 11 and not able to upgrade it now.

Could you please release 11.4.6 as soon as possible?

Thank you.

@scastaldi
Copy link

If you are still in Angular 11 (or any version before primeng fix) this is how I was able to fix it...

<label for="state" [ngClass]="{ 'p-inputwrapper-filled-label': address.stateId > -1 }">State </label>

@awsdevelopvn
Copy link

I fixed the issue by setting the property [autoDisplayFirst]="false"
Something like this

<p-dropdown inputId="customerAddress" [autoDisplayFirst]="false" [options]="selectedCustomer.deliveryAddresses" [(ngModel)]="order.deliveryAddressId" optionLabel="address" optionValue="id" name="customerAddress" styleClass="text-bold"></p-dropdown> <label for="customerAddress">{{"DeliveryAddress" | localize}}</label>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTS-FIXED-10.1.3 Fixed in PrimeNG LTS 10.1.3 LTS-FIXED-11.4.6 Fixed in PrimeNG LTS 11.4.6 Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

7 participants