mui/material-ui

Error validation on Checkbox/RadioButtons?

amitthakkar22288 opened this issue · 3 comments

We do have errorText prop for Textfields and selectfields. As per the spec they are not supported for checkboxes/radiobuttons?

how do we handle validations on switches?
is there any other way we need to handle this?

Currently the material design spec does not clearly specify how did should be handled.

You could use divs for now to show errorTexts in them using onCheck event handler.

I am closing this issue for now, if you need further help you could use the gitter channel of material-ui or post your question on stackoverflow using ''material-ui tag.

I would add that the most obvious reason for this apparent omission is that there is theoretically no incorrect state for CheckBox or RadioButtons.

(Theonly exception might be the "Accept the Terms & Conditions" Checkbox anti-pattern.)

Check out this for a solution.