Closed joshbrekke closed 3 years ago
The toggle control appears to fire 3 times per toggle. Here's a example to replicate the issue...
Markup:
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script> <link href="https://cdn.jsdelivr.net/gh/gitbrent/bootstrap4-toggle@3.6.1/css/bootstrap4-toggle.min.css" rel="stylesheet"> <script src="https://cdn.jsdelivr.net/gh/gitbrent/bootstrap4-toggle@3.6.1/js/bootstrap4-toggle.min.js"></script> <input id="toggle" type="checkbox" data-toggle="toggle" data-on="Active" data-off="In-Active" data-onstyle="success" data-offstyle="danger" data-size="sm">
JavaScript:
<script> $(document).ready(function () { $('#toggle').change(function () { console.log($(this).prop("checked")); }); } </script>
Console Output:
false true false
Has anyone else experienced this issue before?
Thanks,
Josh
Still testing.
The toggle control appears to fire 3 times per toggle. Here's a example to replicate the issue...
Markup:
JavaScript:
Console Output:
Has anyone else experienced this issue before?
Thanks,
Josh