Open morrow95 opened 5 years ago
Has anyone managed to fix it, other then using an older version?
It is still not working... Unfortunately!
I didn't bother comparing the js from the old/new, but something definitely changed within it to cause this issue.
In the getClasses
function, the filter's return should be return v !== null;
instead of ==
.
Solved here with this:
$(function() {
$('[data-switch="true"]').each(function () {
$(this).bootstrapSwitch({ state: $(this).is(':checked') }).trigger('change');
});
});
In the
getClasses
function, the filter's return should bereturn v !== null;
instead of==
.
Shouldn't it be return v != null;
to also include undefined
value ? Because v seems to be undefined
instead of null...
The strict operator still leads to classes like this: bootstrap-switch-undefined
checked / unchecked specified in the html of the input is no longer respected with version 3.4. They will always show in an 'off' state regardless of the true state of the input when loaded.
An example is shown below. This worked perfectly fine with version 3.3.4, yet in 3.4 this will show the switch in an off state when it clearly has 'checked' in the html.
<input type="checkbox" class="make-switch" data-size="small" data-label-width="15" data-on-color="success" data-off-color="danger" data-on-text="Yes" data-off-text="No" name="name" value="1" checked>