Not a bug XF.Disabler does not hide the choice in <xf:checkbox />

TickTackk

Well-known member
Affected version
2.2.2
Sample code
HTML:
<xf:checkboxrow>
    <xf:option name="blah"
               label="{{ phrase('abc_xyz_type.blah') }}"
               data-xf-init="disabler"
               data-hide="true"
               data-container=".js-hideThisplz" />

    <xf:option class="js-hideThisplz" name="blah2"
               label="{{ phrase('abc_xyz_type.blah2') }}" />
</xf:checkboxrow>
This only disables the actual hidden input but does not hide the choice itself.
 
This is expected because the class here is applied to the input[type="checkbox"] element itself which through various magic is already essentially hidden because we replace it with an FA icon.

So you'd need to apply the class to another element or do something different entirely.

This would probably work:

HTML:
<xf:checkboxrow>
    <xf:option name="blah"
               label="{{ phrase('abc_xyz_type.blah') }}"
data-xf-init="disabler"
data-hide="true"
data-container=".js-hideThisplz" />

    <xf:option labelclass="js-hideThisplz" name="blah2"
               label="{{ phrase('abc_xyz_type.blah2') }}" />
</xf:checkboxrow>
 
Top Bottom