Page 1 of 1

How to keep a fixed dropdown width in primevue?

Posted: 10 Mar 2020, 00:15
by rajnandha15
Hello,

I am new to PrimeVue. I am using drop down component with single value selection in my application and I observed that the width of the drop down changes dynamically to match the currently selected value. Is there a way to keep the width of the drop down fixed irrespective of the changes in values?

Thanks!

Re: How to keep a fixed dropdown width in primevue?

Posted: 12 Mar 2020, 17:50
by cagatay.civici
You may use style or class props.

Code: Select all

<Dropdown :style="{min-width: '12em'}"
or

Code: Select all

<Dropdown :class="my-select}"

Code: Select all

.my-select {
 min-width: 12em;
}
or global;

Code: Select all

.p-dropdown {
 min-width: 12em;
}
Hope it helps.