Bootstrap Drop Down Cutting Off

Bootstrap drop down cutting off

Check whether media class is has overflow:hidden. If so, replace it with overflow: auto or overflow: visible.

Dropdown menu is cutting off in jquery ui modal dialog

Answering my own question since got it working and this could be helpful to others in the future.

jquery.ui.dialog creates a wrapper .ui-dialog around the element you want to make as a dialog.

You'd need the both, your dialog element and the jquery.ui dialog wrapper, to have overflow: visible set.

.ui-dialog,
#myDialog {
overflow: visible;
}

https://jsfiddle.net/anmatika/dy3am21n/22/

CSS Drop down list being contained and cut off inside of div

Posting Comments:

  • I would tag Bootstap here for more responses.
  • I would post a smaller more specific section of your html.

Possible Answer to Question:

  • Instead of dropdown, try dropleft. I would also remove text-right from there as well unless you really want everything aligned right there.
    • https://getbootstrap.com/docs/4.6/components/dropdowns/#dropleft
  • If you still want it going right, outside of it's container, what iguypouf said in the comments is correct, remove overflow: hidden;.

Other Comments:

  • I would separate the workCards from the col-md-4 so instead of <div class="col-md-4 workCards">... it could be <div class="col-md-4"><section class="workCards">...
  • Consider replacing the <h1> you are using as the dropdown button with a <button> element. This will be far better for accessibility. If you still want the styling to be like an <h1> tag, Bootstrap has the class .h1 that will work.
    • https://getbootstrap.com/docs/4.6/content/typography/#headings
  • With Bootstrap you could use <h2 class="text-center"> instead of <h2 style="text-align: center;">. Bootstrap has a ton of helpful helper classes.
    • https://getbootstrap.com/docs/4.6/utilities/
  • You might consider renaming text-right as it is already an existing Bootstrap class. Additionally, you won't need it anymore if you replace the <h1> with a <button> (from the bullet point above.)
  • I would replace <b> tags with <strong> tags.
    • https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strong#%3Cb%3E_vs._%3Cstrong%3E
  • Everything from Organization Number: to Status: should probably be in it's own <div class="row">.
  • The final row with the work button does not need two empty col-md-4. Instead you could one col-md-4 and add class justify-content-end to the parent row. You could get rid of that <p> tag in there as well as it's not doing much.
    • https://getbootstrap.com/docs/4.6/layout/grid/#horizontal-alignment

Bootstrap dropdown - right side of the list gets cut off on Firefox

This issue will solve if you wrap your select field by a div element which width 98% like :

<div class="col-md-1">
<div style="width:98%">
<select name="unit" size="1" class="form-control unit" required>
<option value="kW">kW</option>
<option value="MW">MW</option>
<option value="GW">GW</option>
<option value="kWh">kWh</option>
<option value="MWh">MWh</option>
<option value="GWh">GWh</option>
</select>
</div>
</div>

Bootstrap 4: Dropdown menu is going off to the right of the screen

Bootstrap has this built in already: See Menu Alignment. Just add the dropdown-menu-right class to the dropdown-menu div.

<div class="dropdown-menu dropdown-menu-right">

Working Example: (open Full Page)

<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css" rel="stylesheet" />
<nav class="navbar navbar-expand-xl navbar-dark bg-primary">

<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>

<a class="navbar-brand" href="#">Company</a>

<div class="collapse navbar-collapse" id="navbarSupportedContent">
<form action="#" class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" id="keyword" name="keyword" :value='keyword' type="text" placeholder="Search for jobs" />
<input class="form-control mr-sm-2" id="location" name="location" :value='location' type="text" placeholder="Location" />
<button class="btn btn-secondary my-2 my-sm-0" type="submit">Find Jobs</button>
</form>

<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a href="#" class="nav-link active">
<strong>Post Job</strong>
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<strong>Register</strong>
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<strong>Profile</strong>
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<strong>My Jobs</strong>
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<strong>My Searches</strong>
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<strong>Employer Dashboard</strong>
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<strong>Login</strong>
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<strong>Logout</strong>
</a>
</li>
</ul>

<ul class="navbar-nav">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<strong>Account</strong>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
<a class="dropdown-item">
<strong>Register</strong>
</a>
<a href="#" class="dropdown-item">
<strong>Profile</strong>
</a>
<a href="#" class="dropdown-item">
<strong>My Jobs</strong>
</a>
<a href="#" class="dropdown-item">
<strong>My Searches</strong>
</a>
<a href="#" class="dropdown-item">
<strong>Employer Dashboard</strong>
</a>
<a href="#" class="dropdown-item">
<strong>Login</strong>
</a>
<a href="#" class="dropdown-item">
<div class="dropdown-divider"></div>
<strong>Logout</strong>
</a>
</div>
</li>
</ul>
</div>
</nav>

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/2.4.2/umd/popper.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/js/bootstrap.min.js"></script>


Related Topics



Leave a reply



Submit