Issue found in Bootstrap-Multiselect plugin: The dropdown menu appears beneath the outer container when overflow-y is applied

My experience with using Bootstrap-Multiselect and encountering an issue where the dropdown disappears when the outer container has overflow-y: scroll and a max-height has prompted me to seek solutions. I am looking for a way to ensure that the dropdown is displayed over the filter-container.

The HTML structure:

<div class="container filter-container">    

 <div class="row">
  <div class="col-md-12 search-box">          
      <div class="col-md-12">
        <form role="form-inline">
          <div class="form-group search-form-group">
            <label class="search-label">Users:</label>
            <div class="mid-width">
              <select class="select-users form-control"></select>
            </div>
          </div>
        </form>    
      </div>                                                                                        
  </div>  
 </div>  

</div>  

The CSS style:

.filter-container {
    padding: 1%;
    border: 1px solid #eee;
    max-height: 100px;
    overflow-y: scroll;
    background-color: #f8f8f8;
}

Javascript handling:

$(document).ready(function() {
  $('.select-users').multiselect({
        maxHeight: 400,
        buttonWidth: '100%' 
    });
    var accounts = [
        { label: 'UserID 1', value: '1' },
        { label: 'UserID 2', value: '2' },      
        { label: 'UserID 3', value: '3' }, 
        { label: 'UserID 4', value: '4' },         
        { label: 'All', value: '' }  
        ];  

    $('.select-users').multiselect('dataprovider', accounts);  
});

For more details, check out this Fiddle or visit this link on GitHub addressing a similar issue.

Answer №1

Include a new style in your stylesheet

.dropdown-menu {
  display:block;
}

JSFiddle link

Answer №2

Give this a try

<select class="selectpicker" multiple>
  <option>Mustard</option>
  <option>Ketchup</option>
  <option>Relish</option>
</select>

Check out this example here

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Steps for adding a delete icon to a text input field and enabling the functionality to delete text

In the code snippet below, I am creating a text input field: <input type="text" class="signup-input text-value" name="" placeholder="e.g. <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2d48554c405d41486d">[email pro ...

Could the quantity of JavaScript files impact the performance of a project and cause any delays?

In my current HTML and JavaScript project, I am incorporating multiple JavaScript files. I'm curious to learn about the potential impact of having numerous JavaScript files on a web project's efficiency and speed. Can anyone shed some light on th ...

I'm looking for assistance on how to set the minimum height using jQuery. Can anyone provide

My attempt to use the minHeight property in one of my divs is not successful, and I am unsure why... <div id="countries"> <div class="fixed"> <div class="country" style="marging-left:0px;"></div> <div class="country"&g ...

Having difficulty retrieving data from JSON file using Backbone framework

When I click on the div, I am attempting to retrieve JSON data but am unable to view the output. I am utilizing Backbone Collection to fetch JSON data. I have tried displaying the JSON data in the console as well as within another div. The contents of the ...

Datatables efficiently retrieve search data directly from the client side while processing on the server side

I've been tackling this issue daily without any luck in finding a solution. My problem can be described as follows: When searching for the date 25th Apr, it doesn't work; however, if you search using the format 04-25, it works. In my current pr ...

When sending an AJAX request to a URL, can I verify in the PHP page whether it is a request or if the page has been accessed?

In order to enhance security measures, I need to prevent users from accessing or interacting with the php pages that will be utilized for ajax functionality. Is there a method available to determine if a page has been accessed through an ajax request or b ...

Displaying dynamic content on a dialog using jQuery

I am implementing a dialog function as shown below: function OpenCopyDialog() { var $link = $(this); //keep track of the element that was clicked $("#confirmCopyBox").html("</br><h2>Your are about to copy application number: <span>P< ...

Hold off on submitting the form until the location has been obtained

I am facing an issue with my application where it tries to retrieve location settings from the browser, which takes some time. I would like this process to run when the page loads so that the data is available when needed. However, if a user clicks the s ...

Is an input field/text area necessary for the traditional copy to clipboard feature?

I needed to copy a section of text enclosed within an anchor tag to the clipboard. Following suggestions found online, I implemented the code below: HTML: <div class="organizer-link"> <i class="fa fa-link" id="copylink"></i> <a href ...

Access dynamic content from Tinymce 4.x without any manual effort

Is there a way to extract the HTML content from a tinyMCE editor and display it on a page without using the tinyMCE editor itself? I know about the getcontent() function in tinyMCE, but is there another function, parameter, or plugin that can be used to ...

Refresh information by clicking on the data input

Essentially, I have a jsp file with a form and a hidden div structured like this: <div style="visibility:hidden;" id="popup"> //several input </div> <form> //several input </form> Both the div and form tags contain the sa ...

Exploring scraping capabilities in Node.js

Currently, I am in the process of developing a scraping engine using Node.js to collect data for my currency exchange graphs. I am utilizing request and cheerio for this task. However, due to some bank websites not following standard HTML practices by not ...

Troublesome button appearance

I set up two sections to gather user information using buttons. My goal is for the button styles to change when clicked, making it clear to users which option they have selected, even if they switch between sections. However, I encountered an issue where ...

Unraveling the Mystery of jQuery Syntax

Upon reviewing jquery.ui-1.8.11.js: $.extend(Datepicker.prototype, { /* A unique class name appended to elements indicating they are configured with a date picker. */ markerClassName: 'hasDatepicker', /* For debugging purposes (if e ...

Validating Emails with Bootstrap and JQuery

Can anyone help me validate an email ID using Bootstrap? I've tried multiple methods, but it just doesn't seem to work. <label class=".col-xs-12 .col-sm-6 .col-lg-8" style="margin-left:-1%; margin-right:10%">Email</label> <input ...

Guide on transmitting information from two separate pages to a PHP script simultaneously using an AJAX request

Looking to gather user information from a form and pass it onto another page smoothly. Origin Site <form action="destination.php" method="post"> Name: <input type="text" name="name"> Email: <input type="text" name="email"> <input typ ...

Guide to adding an icon within an HTML `<input>` element

Is anyone able to help me successfully place my icon font inside the search input field? I've tried adjusting the margin and padding, but nothing seems to be working! If you have any insights or suggestions, please let me know. Your help is greatly a ...

Tips for updating the hover effect color on Material UI select component options in a React JS application

I've been trying to customize the hover effect for the options in the mui Auto Complete component drop-down menu, but I'm having trouble finding the right method to do so. Here is the hover effect that I want to change: Image I'd like to u ...

Creating a designed pattern for a textbox: Let's get creative with your text

How can I create a Textbox that only allows numeric values or the letter 'A'? <input type="text" id="txt" name="txt" pattern="^[0-9][A]*$" title="Allow numeric value or only Letter 'A'&quo ...

The issue with height percentages being ineffective in CSS

My goal is to utilize the height property with percentages, however it seems to be ineffective. I desire to use percentages so that the layout appears well in various resolutions. <div id="bloque_1" style="height: 80%;background: red"> </div> ...