Issue T14488
Visible to All Users

Text colour for disabled boolean checkbox

created a year ago (modified a year ago)

Hello,

I have some questions in my survey that require just a single checkbox acting as a boolean. Presently I use "type": "checkbox" with a single entry in "choices" which does the job. The main negative of this is that it returns an array. I noticed that now a boolean can be rendered as a checkbox so I gave that a go. It seems to work well although when that question is made disabled, it doesn't change the label text to grey as it would a regular checkbox.

I would prefer to "type": "boolean" with "renderAs": "checkbox" although without the question appearing disabled when disabled I would rather not. I don't fancy adjusting the css myself since I don't know enough about it.

Would it be possible to extend the disabled question colour scheme to a disabled question rendered with "type": "boolean" and "renderAs": "checkbox"?

My ideal would be:

JSON
{   "type": "boolean",   "name": "checkboxQuestion",   "label": "no date",   "startWithNewLine": false,   "titleLocation": "hidden",   "enableIf": "{dateQuestion} empty",   "requiredIf": "{dateQuestion} empty",   "renderAs": "checkbox", },

Thanks,
Stuart

Comments (2)

    Hello Stuart,
    Thank you for reaching out to us. Of course, I agree that we should fix this and change the label color to disabled color when the Boolean checkbox is disabled. I forwarded the following issue to our developers for further investigation: https://github.com/surveyjs/survey-library/issues/6869.
    We'll keep you updated of our progress.

    Thanks

      In the meantime, you can use the following CSS to update the color of a label in disabled state:

      CSS
      .sd-checkbox--disabled .sd-item__control-label { color: var(--foreground); opacity: 0.25; }

      View Demo

      I hope this example can help you. Please stay tuned to our updates.

      Answers approved by surveyjs Support

      created a year ago

      Stuart,
      The issue was fixed and is already available with the most recent version v1.9.109: View Demo.

      Should you have any further questions, we are always here to help.