SelectOneMenu Width Too Small

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
User avatar
undermensch
Posts: 140
Joined: 08 Jul 2010, 14:37
Location: Florida, United States

08 Oct 2020, 18:55

The width does not seem to be calculated correctly with the p:selectOneMenu. The down-chevron icon covers the last letter of the item.
PrimeFaces-11.0.6 / Wildfly 24

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

09 Oct 2020, 13:29

Unfortunately, I couldn't replicate it. Do you attach a sample code block for us to replicate? Which options are you using in SelectOneMenu?

Best Regards,

User avatar
undermensch
Posts: 140
Joined: 08 Jul 2010, 14:37
Location: Florida, United States

12 Oct 2020, 16:41

Here's an example:

Code: Select all

<h:panelGrid columns="2">
                                <p:outputLabel for="theme" value="Theme:"/>
                                <p:selectOneMenu id="theme" required="true" requiredMessage="Select a theme!"
                                                 value="#{editTeacherBean.user.theme}">
                                    <f:selectItems value="#{editTeacherBean.themes}"/>
                                </p:selectOneMenu>
</h:panelGrid>
Image

The down chevron covers the last letters of the longer items. If the padding: 0 is removed from the rain-cyan-light theme.css, the problem seems to be resolved.

Code: Select all

body .ui-selectonemenu {
  vertical-align: baseline;
  border: 1px solid #D9DEE6;
  position: relative;
  transform: none;
  padding: 0;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
  border-radius: 4px;
  background: #ffffff;
}
Thanks.
PrimeFaces-11.0.6 / Wildfly 24

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

13 Oct 2020, 08:57

Hi,

Thanks a lot for the sample code block. Fixed for the next version. For now, please try;

Code: Select all

body .ui-selectonemenu .ui-selectonemenu-label {
    padding-right: 2.357rem;
}

body .ui-fluid .ui-selectonemenu-label {
    padding: 0.5rem 0.5rem;
}
Best Regards,

User avatar
undermensch
Posts: 140
Joined: 08 Jul 2010, 14:37
Location: Florida, United States

13 Oct 2020, 14:22

Great. Thanks!
PrimeFaces-11.0.6 / Wildfly 24

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

13 Oct 2020, 14:29

You're welcome!

Best Regards,

Post Reply

Return to “Rain - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests