Richard Lermite
Richard Lermite

Reputation: 41

Accordion is breaking the height of the div

I'm using Angular and ng-bootstrap.

I've a problem with the accordion component (https://ng-bootstrap.github.io/#/components/accordion/examples)

When I put an accordion into a div with a max-height, the accordion can go over this max-height.. But I want to get the max-height of my div respected.

To reproduce the bug it's simple :

Create a div with a max-height (for example 80% and width: 200px) then put inside few accordions with few panels for each. Then open them and you'll see your panels going over the max height.

What I want is to have a scrollbar on my div and not on my body but it's not working even with a max height inside of my div.

Upvotes: 4

Views: 1818

Answers (1)

amirify
amirify

Reputation: 805

set overflow: auto; to your div. if didn't work set the max-height with px unit. I did it and worked for me.

Upvotes: 1

Related Questions