carbon icon indicating copy to clipboard operation
carbon copied to clipboard

Checkbox validation gives console warnings/errors about disabled vs read-only mode.

Open Chris3y opened this issue 2 years ago • 1 comments

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.

Chris3y avatar Sep 05 '22 14:09 Chris3y

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?

nicktitchmarsh avatar Sep 06 '22 12:09 nicktitchmarsh

Hi @Chris3y, do you have an update on this one regarding Nick's comment above?

Parsium avatar Oct 25 '22 13:10 Parsium

@tempertemper, I believe the above request would not be accessible and therefore we should keep the warning here

nicktitchmarsh avatar Nov 15 '22 14:11 nicktitchmarsh

Yeah sounds a bit like a pattern to be avoided 👍

tempertemper avatar Nov 23 '22 17:11 tempertemper