-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Dropdown autoWidth is not updated on value change #4747
Comments
Same issue with Angular version: 5.1.3 |
Hi, Try to give a custom width by yourself like the following. <p-dropdown formControlName="name" [options]="names" [style]="{'width':'100%'}"> Read from https://github.com/primefaces/primeng/issues/524 It would be nice though someone to worl on this issue. |
Hi, |
@dimaslanidis I was scouring the internet looking for anything related to my p-dropdown issue and tried the style trick and it worked! +1 !!! My scenario is as follows:
On initial rendering everything is fine. However, I have an ngIf on I was searching for ways to "trigger this render" and was going through every option on p-dropdown. So when I saw your [style] suggestion, I thought EUREKA, that might "trigger" the display to render properly, and turns out it did!!! :D Note: if the devs are need a replicable scenario I can try to put one together on stackblitz |
I've used width: auto, because I didn't want to fill the whole row with the control. It's a hack, anyway. |
I'm submitting a bug report
Plunker:
https://plnkr.co/edit/YBl5bOWqGTT3Ve5vMdg2
Current behavior
When p-dropdown is opened from a dialog and initialized with a value, the drop-down is rendered empty. The default value is not selected.
Expected behavior
This should work in a dialog the same way as it works elsewhere, as it is a common use case
Minimal reproduction of the problem with instructions
See plunker. The potential workaround is to pull the list of options from a remote location (or do some delays with code) as there is likely some order of rendering that causes this issue.
What is the motivation / use case for changing the behavior?
Make the PrimeNg framework work right.
**Please tell us about your environment:**VS Code, Plunker
node --version
=The text was updated successfully, but these errors were encountered: