select2 in bootstrap v4 dropdown : fails on mobile

184 views
Skip to first unread message

lenb...@gmail.com

unread,
Apr 26, 2016, 11:25:38 AM4/26/16
to select2
I posted this on stackoverflow (http://stackoverflow.com/questions/36867489/select2-in-bootstrap-v4-dropdown-menu), but thought I should ask here as well.

My current best try is at: outtopastureenterprises.com/selectInDropdown.html, and the code is repeated below.

It works fine on desktop, but not on mobile. Any help greatly appreciated.
Thanks
--Len

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" integrity="sha384-y3tfxAZXuh4HwSYylfB+J125MxIs6mR5FOHamPBG064zB+AFeWH94NdvaCBm8qnd" crossorigin="anonymous">
<link rel="stylesheet" href="../../css/view.css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.2/css/select2.min.css" rel="stylesheet" />

<title>Test</title>

</head>

<body>
<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>

<!-- jQuery first, then Bootstrap JS. -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.2/js/select2.min.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.1.1/js/tether.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.touchswipe/1.6.15/jquery.touchSwipe.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/js/bootstrap.min.js" integrity="sha384-vZ2WRJMwsjRMW/8U7i6PWi6AlO1L79snBrmgiDpgIWJ82z8eA5lenwvxbMV1PAh7" crossorigin="anonymous"></script>

<script>
$(document).ready(function(){
$('select').select2();
});

</script>

</body>
</html>

Reply all
Reply to author
Forward
0 new messages