Reputation: 4953
I have an issue when expanding panels within my accordion in my Angular App. Basically if I expand a panel this is expanding and going over the footer of my application so I was thinking on adding a scrollbar to the accordion so it doesn't go over the footer anymore but I'm not sure where to start. Does anyone know how to add a scrollBar to accordion ? My guess is that I will need to put the accordion in a container and then add a scrollbar ? Here's my code and would like to add a scrollbar.
<p-accordion [activeIndex]="index">
<p-accordionTab header="Header 1">
Content 1
</p-accordionTab>
<p-accordionTab *ngIf="true" header="Header 2">
Content 2
</p-accordionTab>
<p-accordionTab header="Header 3">
Content 3
</p-accordionTab>
Here are two images on what happens with my footer when a panel gets expanded:
1) BEFORE Expanding Panel
2) AFTER Expanding Panel
Upvotes: 3
Views: 5011
Reputation: 6655
Just add these CSS properties to the p-accordion
element :
height: 275px;
display: block;
overflow: scroll;
Upvotes: 1