carbon
carbon copied to clipboard
Checkbox validation gives console warnings/errors about disabled vs read-only mode.
Current behaviour
Checkboxes (and not tested but I suspect radio buttons) have had some internal validation added which checks for error/warning/info props passed while in "disabled" mode and warns/errors that controls should use read-only instead of "disabled".
Problem is, several form components don't have a "read-only" mode. There's no way to meaningfully interact with them unless you're changing their value.
Expected behaviour
I would expect no validation for these control typees.
CodeSandbox or Storybook URL
https://codesandbox.io/s/crazy-shadow-15vl2z?file=/src/index.js
JIRA Ticket (Sage Only)
No response
Suggested Solution
Remove this test for controls that don't have a "read-only" mode
Carbon Version
109.3.1
Design Tokens Version
No response
What browsers are you seeing the problem on?
Chrome
What Operating System are you seeing the problem on?
Windows
Anything else we should know?
No response
Confidentiality
- [X] I confirm there is no confidential or commercially sensitive information included.
Hi @Chris3y, Just trying to understand a situation where you need a checkbox or radio set to be both in an error state and to be read-only? If the input is not interactive why do we display validation associated with it?
Hi @Chris3y, do you have an update on this one regarding Nick's comment above?
@tempertemper, I believe the above request would not be accessible and therefore we should keep the warning here
Yeah sounds a bit like a pattern to be avoided 👍