How to keep a fixed dropdown width in primevue?

UI Components for Vue
Post Reply
rajnandha15
Posts: 1
Joined: 10 Mar 2020, 00:08

10 Mar 2020, 00:15

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!

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

12 Mar 2020, 17:50

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.

Post Reply

Return to “PrimeVue”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 17 guests