Open Mina-R-Meshriky opened 4 years ago
I've just run into this problem, managed to work around it by enclosing the input in a div and then using a delegated click event on .toggle for that div, this picks it so I can do a check first.
<div class="toggle-div"><input class="toggle-option" type="checkbox" data-toggle="toggle"></div>
$('.toggle-div').on('click', '.toggle', function(e) { e.preventDefault(); e.stopPropagation(); console.log('clicked')});
Only the Change event is firing correctly, but the on click event never fires.
I need the click event, since I want to show a warning before changing the state of the toggle