Dropdown inside responsive table row clipped even with data-bs-boundary set

See original GitHub issue

A dropdown inside a responsive table row gets clipped even with data-bs-boundary set

Removing the table-responsive class from the parent div solves the issue, but we lose responsiveness.

Another workaround is to add style=“position:static” to the dropdown class div, and it doesn’t clip after.

Not sure if that’s expected or should be considered an issue.

OS: Ubuntu 20.04 Browser: Firefox 87 Bootstrap: bootstrap@5.0.0-beta3

Example:

<div class="table-responsive">
    <table class="table">
        <tr>
            <td>
                <div class="dropdown">
                    <a class="dropdown-toggle" href="#" role="button" id="dropdownMenuLink"
                       data-bs-toggle="dropdown"
                       data-bs-boundary="viewport"
                       aria-expanded="false"
                    >
                        Options
                    </a>
                    <ul class="dropdown-menu" aria-labelledby="dropdownMenuLink">
                        <li><a class="dropdown-item" href="#">Item</a></li>
                        <li><a class="dropdown-item" href="#">Item</a></li>
                        <li><a class="dropdown-item" href="#">Item</a></li>
                        <li><a class="dropdown-item" href="#">Item</a></li>
                        <li>
                            <hr class="dropdown-divider">
                        </li>
                        <li><a class="dropdown-item" href="#">Item</a></li>
                    </ul>
                </div>
            </td>
        </tr>
    </table>
</div>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
korki43commented, Apr 19, 2021

I think this is expected, due to overflow-x: auto in .table-responsive. Anyways, here’s an example codepen.

1reaction
wadihcommented, May 22, 2022

@mrlife I just tested it in the codepen above and it still works. You can add position: static to the .dropdown div and it should not clip anymore.

Update: you can use position-static class as a shorthand

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bootstrap button drop-down inside responsive table not visible ...
I solved myself this and I put the answer in scope to help other user that have same problem: We have an event...
Read more >
Dropdown menu inside a cell...problem with overflow
I'd like to insert different dropdown menu inside a cell in datatables. Without this CSS code: .table-responsive, .
Read more >
Dropdowns - Bootstrap
Dropdowns are toggleable, contextual overlays for displaying lists of links and more. They're made interactive with the included Bootstrap dropdown ...
Read more >
Stop Bootstrap drop menu's being cut off in responsive tables
Bootstrap's dropdown menu's a great for display items in a tidy way but suffer for being cut off when on mobiles due to...
Read more >
Bootstrap Dropdown clipping at bottom of table - HTML & CSS
Hi guys Has anyone found an elegant (or even, a not so elegant solution) ... in sperate table cells for each row I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found