-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Indeterminate state missing for ChoiceGroup (and formerly Checkbox) #5390
Comments
Alright, so we currently don't support the mixed state for checkbox, but I can see how we may want to. As for radio buttons, there really isn't a situation where there would be an intermediate state for a mutually exclusive selection control. Mixed states in checkboxes occur when there is a master checkbox, and some of the child checkboxes are not selected. What scenario would you solve with a mixed state radio button? I'm trying to understand what that would mean. |
When there is a radio group and none of the radio buttons in that group are checked when they are inserted into the document, they are said to be indeterminate. A "reset form" button comes to mind as does the pseudo selector for identifying form controls that require values. This represents a fairly common use case IMO. Philosophical and use cases arguments aside, parity with native controls should be a goal of any robust UI toolkit. Assumptions about developer requirements that reduce access to longstanding native features can mean several hours of time spent on workarounds. Implementing an indeterminate state on a Fabric checkbox and radio button because it is not provided is case in point. :) |
So you're saying that this is a "state" that is in addition to being unselected? |
Ok, so this "indeterminate" radio button state appears "unchecked" correct? If so, then I can see that case. |
@betrue-final-final We can certainly take a look at adding this feature in the upcoming month or two. Do you have designs we can refer to when implementing this intermediate state? |
@ecraig12345 I added you here to update our docs regarding controlled vs uncontrolled components and best practices for resetting uncontrolled ones. I agree there might be some work to properly support this checkbox state, but for radio buttons this shouldn't be handled by a prop. To reset an uncontrolled choice group you should re-render the choicegroup with a different key. https://codepen.io/dzearing/pen/rogove |
Sorry about that accidental close. |
We should consider this with refreshes to checkbox and radiogroup |
This was fixed for Checkbox (but not ChoiceGroup) sometime after this issue was created. |
Because this issue has not had activity for over 150 days, we're automatically closing it for house-keeping purposes. Still require assistance? Please, create a new issue with up-to date details. |
I'm going to leave this closed because it's been fixed for Checkbox, and at least to me, it's not obvious what an indeterminate state in ChoiceGroup would look like or mean. (Note that indeterminate is not the same as resetting to nothing selected, which could be achieved by re-rendering with a different key as Micah mentioned.) If anyone is interested in any related features, please open a new issue with detailed information about your use case and how you'd expect it to behave and look. |
It appears that the indeterminate state for the checkbox and radio is missing from the Fabric version.
I would have expected the
ICheckbox
andICheckboxProps
interfaces to contain anindeterminate
boolean to support this. Is there a workaround for those that require this use case?The text was updated successfully, but these errors were encountered: