0
これは本質的に私の質問ですselect in bootstrap v4 dropdown;しかし、私はそれにselect2タグを追加する必要がありました。言い換えると、私はドロップダウンメニューに選択ボックスを入れたいと思う。それはデスクトップ上で動作しますが、モバイルでは(実際はそうではありません)それはouttopastureenterprises.com/selectInDropdown.htmlに投稿されていますselect2 in bootstrap v4ドロップダウンメニュー
私はこのタグで再転記した理由は、select2なしでは、モバイルではまったく動作しません。
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenu1">
<span class="dropdown-item" ><input type="text"/></span>
<span class="dropdown-item" >
<!--<span>Grid Size</span>-->
<select class="c-select" style="width: 50%" id="gridSize">
<option>Grid Size</option>
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
</span>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</div>
<script>
$(document).ready(function(){
$('select').select2();
});
</script>