I am using JS Select2 library to use as multiple options select. The select is positioned within a div
which is scrolled by its parent div
with css
- overflow-y: scroll
. The nested div
scrolls fine until an option is opened. When options are opened then the div
becomes un-scrollable unless it is scrolled on the select options. Not sure if the source of the problem is my html/css or its the select2
lib.
Thanks in advance for any help!
My markup:
<div id="topcontainer" style="padding-top: 100px; overflow-y: scroll; position: absolute; height: 1000px; width: 500px; background: #6d3353">
<div id="parent" style="position: relative; height: 3000px; width: 200px; background: #e4b9b9">
<select class="js-example-basic-multiple" name="states[]" multiple="multiple">
<option value="AL">aaaaaaa</option>
<option value="AL">bbbbbbb</option>
<option value="AL">ccccccc</option>
<option value="WY">ddddddd</option>
</select>
<script>
$(document).ready(function () {
$('.js-example-basic-multiple').select2();
});
</script>
</div>