Nikola
Nikola

Reputation: 624

p:selectOneMenu with relative width stretches out when resizing browser

When I increase browser's window size (e.g. changing resolutions from 1024x768 to 1920x1080), the <p:selectOneMenu> becomes from this:

before 1024x768

to this:

after

I figured out that the problem arises when I add a relative width to the component, e.g:

<p:selectOneMenu ... style="width: 30%;">

How can I remove the unnecessary space? I am using PrimeFaces 3.3.1

Upvotes: 1

Views: 2220

Answers (1)

Prakash Bist
Prakash Bist

Reputation: 91

If you do not want the selectonemenu to stretch while resizing or by its text use

.ui-selectonemenu {
    min-width: 0 !important;
}

Perfectly worked for me.

Upvotes: 1

Related Questions