Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boolean rendered as Checkbox: The label is rendered as enabled even in a disabled question #6869

Closed
JaneSjs opened this issue Sep 4, 2023 · 1 comment · Fixed by #6960
Closed
Assignees
Labels
bug user issue An issue or bug reported by users
Milestone

Comments

@JaneSjs
Copy link
Contributor

JaneSjs commented Sep 4, 2023

User Issue: T14488 - Text colour for disabled boolean checkbox
https://surveyjs.answerdesk.io/internal/ticket/details/T14488


When a Boolean question is rendered as a checkbox, the label text is always displayed in an 'active' color regardless of the enabled state of the question.

.sd-item__control-label {
font-family: $font-editorfont-family;
font-style: normal;
font-weight: $font-editorfont-weight;
line-height: multiply(1.5, $font-editorfont-size);
font-size: $font-editorfont-size;
color: $font-editorfont-color;
white-space: normal;
word-break: break-word;
width: 100%;
text-align: left;
}

{
 "title": "Default Form.",
 "description": "Enter a form description",
 "pages": [
  {
   "name": "page1",
   "elements": [
    {
     "type": "boolean",
     "name": "Date"
    },
    {
     "type": "boolean",
     "name": "checkboxQuestion",
     "title": "no date",
     "titleLocation": "hidden",
     "enableIf": "{Date} = true",
     "requiredIf": "{dateQuestion} empty",
     "renderAs": "checkbox"
    }
   ]
  }
 ]
}

image

Enabled, checked, focus out:
image

When the Boolean question has a value, but is disabled, it is rendered as follows:
image

@JaneSjs JaneSjs added bug user issue An issue or bug reported by users labels Sep 4, 2023
@JaneSjs JaneSjs changed the title Boolean rendered as Checkbox - The label fore color is not grayed out when a question is disabled Boolean rendered as Checkbox - The label fore color is always rendered as enabled even though a question is disabled Sep 4, 2023
@JaneSjs
Copy link
Contributor Author

JaneSjs commented Sep 4, 2023

Temporary solution: use custom CSS.

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

View Demo

@dk981234 dk981234 linked a pull request Sep 14, 2023 that will close this issue
@RomanTsukanov RomanTsukanov changed the title Boolean rendered as Checkbox - The label fore color is always rendered as enabled even though a question is disabled Boolean rendered as Checkbox: The label is rendered as enabled even in a disabled question Sep 19, 2023
andrewtelnov added a commit that referenced this issue Sep 21, 2023
@OlgaLarina OlgaLarina added this to the v1.9.108 milestone Sep 22, 2023
tsv2013 pushed a commit that referenced this issue Sep 25, 2023
* Add "clearValueIf" expression into question #6989

* Add tests on matrices #6869

* Change clearValueIf into question trigger clearValueOn #6989

* Support root question in panels/matrices expressions #6989

* Rename clearValueOn to resetValueIf #6989

* Add a description

* rename private properties #6989

---------

Co-authored-by: Roman Tsukanov <roman.tsukanov@devexpress.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug user issue An issue or bug reported by users
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants