Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap button drop-down inside responsive table not visible because of scroll

I have a problem with drop-down buttons inside tables when are responsive and scroll active because the drop-down is not visible because of overflow: auto; property. How can I fix that in order to show drop-down option of button when this is collapsed? I can use some jQuery but after I have problems with scroll left-right so I decided to find another solution. I have attached a photo to understand better.enter image description here

Here is a small js fiddle:

like image 950
BurebistaRuler Avatar asked Sep 24 '14 13:09

BurebistaRuler


People also ask

Why is my bootstrap drop down not working?

Solution : The dropdown should be toggled via data attributes or using javascript. In the above program, we have forgotten to add a data attribute so the dropdown is not working. So add data-bs-toggle="dropdown" to toggle the dropdown.

How do I add a drop down menu to the navigation bar in bootstrap?

Example Explained. Use any element to open the dropdown menu, e.g. a <button>, <a> or <p> element. Use a container element (like <div>) to create the dropdown menu and add the dropdown links inside it. Wrap a <div> element around the button and the <div> to position the dropdown menu correctly with CSS.

How do I move a drop down to the right in bootstrap?

To right-align a menu, use . dropdown-menu-right. Right-aligned nav components in the navbar use a mixin version of this class to automatically align the menu. To override it, use .


1 Answers

I solved myself this and I put the answer in scope to help other user that have same problem: We have an event in bootstrap and we can use that event to set overflow: inherit but this will work if you don't have the css property on your parent container.

$('.table-responsive').on('show.bs.dropdown', function () {      $('.table-responsive').css( "overflow", "inherit" ); });  $('.table-responsive').on('hide.bs.dropdown', function () {      $('.table-responsive').css( "overflow", "auto" ); }) 

and this is the fiddle

info: In this fiddle example works strange and I'm not sure why but in my project works just fine.

like image 178
BurebistaRuler Avatar answered Sep 27 '22 23:09

BurebistaRuler