Monday, November 7, 2022

[FIXED] How to make p:menu scrollable in primefaces?

Issue

I have a menu which I fill programmatically with a model. But I want it to become scrollable when its items become too many to be displayed in the page.

Here is my menu:

<p:menu overlay="true" trigger="imgNotif" my="left top"
at="bottom left" model="#{notifController.model}" />

Is there a way to make it scrollable (programmatically or using its style/attributes)?

Thank you


Solution

Use the following CSS:

.ui-menu {
  overflow-y: scroll;      
  height: 200px;      
}


Answered By - Hatem Alimam
Answer Checked By - Marilyn (PHPFixing Volunteer)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.