Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

overflow-y not working in safari inside a modal

Ok here is the html:

<div style="height: 200px; position: relative;"  id="filterOptionsContainer">     <table id="filterOptionsTable" class="table table-striped table-hover">     </table> </div> 

Basically, I am dynamically adding rows to the table and I would like the container to scroll the overflow. First I tried the obvious:

#filterOptionsContainer {     overflow-y: auto; } 

and that works fine everywhere except for Safari on iOS mobile devices.

Since then I have spent hours trying every combination of styles I can think of and read about but I cannot get standard overflow scrolling. The closest I got was getting the scrollbar to show (it wasn't actually scrolling though).

All help is appreciated. It is hard for me to believe that it is not possible to scroll the contents of a div in a modal in Safari...

like image 624
pQuestions123 Avatar asked Feb 17 '16 22:02

pQuestions123


People also ask

Why overflow is not working in CSS?

Fixed-Width Elements # One of the most common causes of overflow is fixed-width elements. Generally speaking, don't fix the width of any element that should work at multiple viewport sizes.

How do I fix the overflow in CSS?

overflow: scroll Setting the value to scroll , the overflow is clipped and a scrollbar is added to scroll inside the box. Note that this will add a scrollbar both horizontally and vertically (even if you do not need it): You can use the overflow property when you want to have better control of the layout.

Why is overflow hidden?

overflow : hidden is a property which will make any text going out of your div as hidden i.e. it will not be shown on screen and will be clipped. overflow : auto will make scroll bar's appear if the text goes out of your div.

What is Webkit overflow scrolling?

The -webkit-overflow-scrolling CSS property controls whether or not touch devices use momentum-based scrolling for a given element.


1 Answers

Try applying this inline , or through a Jquery Script

 style="overflow-y: scroll; -webkit-overflow-scrolling: touch;" 

or through a Jquery Script

$("#filterOptionsContainer").css({     "overflow-y": "scroll",     "-webkit-overflow-scrolling": "touch" }); 
like image 169
Raja Mohammed Avatar answered Sep 17 '22 23:09

Raja Mohammed