Open norhan22 opened 2 years ago
Hi @norhan22, In bootstrap5-toggle there is support for silence toggle method that can resolve your issue but will requiere move your project to bootstrap5.
$('#toggle-demo').bootstrapToggle('toggle', true);
Hi @norhan22,
I've released a new version for bootstrap 4 in palcarazm/bootstrap5-toggle that support silence toggle method.
I call an ajax request on change the switcher, and I want to prevent the toggling till the ajax response
My Code
HTML
JS
The Issues that I faced
e.preventDefault()
nore.stopPropagation()
$('#toggle-demo').bootstrapToggle('toggle')
, it causes an infinite loopSo I did this
I don't know if that the best way to achieve the target but it works well for me till now