Scroll does not work in bootstrap mode

2

I have a modal with an image on the left and several comments on the right, but on the right I wish there was scroll as the comments did not fit in the modal. So I have this row with several rows inside that will be the comments, but the scroll does not appear and the content is hidden.

CSS

 #comentarios{
    margin-top: 5px;
    margin-right: 5px;
    overflow:visible; 
  }

  #myModal{

    max-height: 540px;
    overflow: hidden;
  }

<div class="modal"  id="myModalProva" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
            <div class="modal-dialog modal-lg" role="document" >
            <div class="modal-content" >
                <div class="modal-body" id="modal-prova" style="padding:0;" >

                    <div class="row">
                        <div class="col-7">
                            IMAGEM
                        </div>

                        <div class="col-5" >
                            <div class="row" id="comentarios">
                               <div class="row" id="comentarios">
                                    <div class="row">   
                                        <div class="col">
                                            <p> - Esse é um teste de um comentário </p>
                                        </div>
                                    </div>
                                    <div class="row">   
                                        <div class="col">
                                            <p> - Esse é um teste de um comentário </p>
                                        </div>
                                    </div>
                                    <div class="row">   
                                        <div class="col">
                                            <p> - Esse é um teste de um comentário </p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                    </div>
                </div>

            </div>
        </div>
        </div>
    </div>

In the first image the modal is with visible overflow realize that the modal is bigger than the size of the image even if I have set the maximum size of the modal with the size of the photo

NowIhaveoverflowhiddeninmodalandithidesthecometintherightdiveventheoverflowofthatdivbeinghidden

Nowtheoverflowofthecommentsdivisscrolling,nowyoucanseethatitcutsthecommentsanddoesnotshowthescroll.

    
asked by anonymous 20.11.2017 / 21:32

1 answer

0

You need to set a value in heigth to your Div on the right where you want the scroll. After that put overflow:auto on her and not on her father. So when the child's content is larger than the parent's, the scroll will appear in the Div.

img {
            display: block;
        }
        .pai div {
            float: left;
            width: 100px;
            border: 1px solid black;
        }
        .of-y {
            height: 100px;
            overflow-y: auto;
        }

Editei a resposta com um modelo simples com coluna da esquerda fixa e da direita com scroll, olha se ajuda. Vale lembrar que o scroll só vai aparecer quando a altura do filho for maior que a altura do pai.
<div class="pai">
        <div class="fixa">
            <img src="http://www.fillmurray.com/100/100"alt="">
        </div>
        <div class="of-y">
            Lorem ipsum dolor sit amet consectetur adipisicing elit. Tempora dolor nostrum cupiditate facilis modi possimus aliquid. Adipisci illo nesciunt omnis.
        </div>
    </div>

[] 's

    
20.11.2017 / 22:11