Primeng: DropDown auto width issue

Created on 4 May 2017  路  4Comments  路  Source: primefaces/primeng

By default autowidth property of DropDown component is true.But the input width is not calculated based on panel width.If we disable the autoWidth behaviour then it works properly.

image

Most helpful comment

Hi, @muhammad-saleh , thank you for your concern !

My problem is solved, it was a silly mistake from me :
<p-dropdown [options]="workspaceOptions" [ngModel]="workspaceInit" (onChange)="changeWorkspace($event)" [filter]="workspaceOptions.length > 5"> [autoWidth]="true" [style]="{'width': '100%'}"> </p-dropdown>
You see the early closing tag ? So autoWidth and style weren't send to the p-dropdown.

But the original issue is still happening !

All 4 comments

I have this problem on autoWidth enabled and disabled, it doesn't change anything for me.
Actually, I can't have a p-drodown with a width matching the elements when the options are dynamics.

Could you try to add this to your style ?

.ui-dropdown-panel {
    max-width: 0;
}

Hi, @muhammad-saleh , thank you for your concern !

My problem is solved, it was a silly mistake from me :
<p-dropdown [options]="workspaceOptions" [ngModel]="workspaceInit" (onChange)="changeWorkspace($event)" [filter]="workspaceOptions.length > 5"> [autoWidth]="true" [style]="{'width': '100%'}"> </p-dropdown>
You see the early closing tag ? So autoWidth and style weren't send to the p-dropdown.

But the original issue is still happening !

Unable to replicate, please provide a test case based on plunkr below and we'll review again.

http://plnkr.co/edit/Wj39h1?p=preview

Was this page helpful?
0 / 5 - 0 ratings