1

i have this html

    <div id="create" class="modal fade" role="dialog">
        <div class="modal-dialog">  
            <div class="modal-content">
           <div class="modal-header">
           </div>
<div class="modal-body">
  <select class="form-control select" name="list" id="list" 
        placeholder="SelectList" required>
   <option value="">Select List</option>
   <option value="">one</option>
   <option value="two">two</option>
   <option value="three">three</option>                                       
</select>
     </div>

              $(document).ready(function(){
$.fn.modal.Constructor.prototype.enforceFocus = function() {};
$('.select').select2({
                dropdownParent: $('#create')
            });

}):

i tried looking for the answer in stack overflow they did have some answers as i have implemented above but it did not seem to work

c319113
  • 215
  • 1
  • 3
  • 11

1 Answers1

0
<i>
<style type="text/css">
        .modal-open .select2-container--open { z-index: 999999 !important; width:100% !important; }
    </style>
</i>

works for me

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135