Open mildred opened 3 years ago
The problem happens with ui_box_switch_field and not ui_switch_field
A form initialized with the following markup contains a ui_box_switch_field. The markup sent by the server is:
<div class="switch-field-container"> <input type="hidden" name="search[design][2e4a02f4-2a88-4d7e-b9de-01574eb57c66][library_view][modules][filters][active]" id="search_design_2e4a02f4-2a88-4d7e-b9de-01574eb57c66_library_view_modules_filters_active" value="0" /> <input type="checkbox" name="search[design][2e4a02f4-2a88-4d7e-b9de-01574eb57c66][library_view][modules][filters][active]" id="search_design_2e4a02f4-2a88-4d7e-b9de-01574eb57c66_library_view_modules_filters_active" value="1" checked="checked" data-on-text="Oui" data-off-text="Non" data-label-text="Activé" class="switch-field" /> </div>
However, the switch appears visually off:
The markup after JS initialisation is:
<div class="switch-field-container"> <input type="hidden" name="search[design][2e4a02f4-2a88-4d7e-b9de-01574eb57c66][library_view][modules][filters][active]" id="search_design_2e4a02f4-2a88-4d7e-b9de-01574eb57c66_library_view_modules_filters_active" value="0"> <div class="bootstrap-switch-undefined bootstrap-switch-undefined bootstrap-switch-undefined bootstrap-switch-undefined bootstrap-switch bootstrap-switch-wrapper bootstrap-switch-animate" style="width: 112.2px;"> <div class="bootstrap-switch-container" style="width: 157.883px; margin-left: -47.6833px;"> <span class="bootstrap-switch-handle-on bootstrap-switch-primary" style="width: 51px;">Oui</span> <span class="bootstrap-switch-label" style="width: 62.5167px;">Activé</span> <span class="bootstrap-switch-handle-off bootstrap-switch-default" style="width: 51px;">Non</span> <input type="checkbox" name="search[design][2e4a02f4-2a88-4d7e-b9de-01574eb57c66][library_view][modules][filters][active]" id="search_design_2e4a02f4-2a88-4d7e-b9de-01574eb57c66_library_view_modules_filters_active" value="1" checked="checked" data-on-text="Oui" data-off-text="Non" data-label-text="Activé" class="switch-field"> </div> </div> </div>
There are suspicious bootstrap-switch-undefined classes
bootstrap-switch-undefined
I'm going to investigate
The problem happens with ui_box_switch_field and not ui_switch_field
A form initialized with the following markup contains a ui_box_switch_field. The markup sent by the server is:
However, the switch appears visually off:
The markup after JS initialisation is:
There are suspicious
bootstrap-switch-undefined
classes