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

Indeterminate state missing for ChoiceGroup (and formerly Checkbox) #5390

Closed
justinwilaby opened this issue Jun 29, 2018 · 11 comments
Closed
Assignees
Labels
Component: ChoiceGroup Needs: Design Resolution: Soft Close Soft closing inactive issues over a certain period Status: Future Consider Consider this issue for future component refreshes Status: Not on Roadmap Issue is not currently on roadmap, no fix planned Type: Feature
Milestone

Comments

@justinwilaby
Copy link

It appears that the indeterminate state for the checkbox and radio is missing from the Fabric version.

I would have expected the ICheckbox and ICheckboxProps interfaces to contain an indeterminate boolean to support this. Is there a workaround for those that require this use case?

@betrue-final-final
Copy link
Member

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.

@justinwilaby
Copy link
Author

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. :)

@betrue-final-final
Copy link
Member

So you're saying that this is a "state" that is in addition to being unselected?

@betrue-final-final
Copy link
Member

Ok, so this "indeterminate" radio button state appears "unchecked" correct? If so, then I can see that case.

@micahgodbolt
Copy link
Member

@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?

@micahgodbolt
Copy link
Member

@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

@maxwellred
Copy link
Contributor

Sorry about that accidental close.

@JustSlone
Copy link
Collaborator

We should consider this with refreshes to checkbox and radiogroup

@ecraig12345
Copy link
Member

This was fixed for Checkbox (but not ChoiceGroup) sometime after this issue was created.

@ecraig12345 ecraig12345 changed the title Indeterminate state missing for Radio and Checkbox Indeterminate state missing for ChoiceGroup (and formerly Checkbox) May 25, 2021
@ecraig12345 ecraig12345 added the Status: Not on Roadmap Issue is not currently on roadmap, no fix planned label May 25, 2021
@tringakrasniqi tringakrasniqi mentioned this issue Oct 5, 2021
33 tasks
@msft-fluent-ui-bot
Copy link
Collaborator

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.

@msft-fluent-ui-bot msft-fluent-ui-bot added the Resolution: Soft Close Soft closing inactive issues over a certain period label Oct 22, 2021
@ecraig12345
Copy link
Member

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.

@microsoft microsoft locked as resolved and limited conversation to collaborators Nov 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Component: ChoiceGroup Needs: Design Resolution: Soft Close Soft closing inactive issues over a certain period Status: Future Consider Consider this issue for future component refreshes Status: Not on Roadmap Issue is not currently on roadmap, no fix planned Type: Feature
Projects
None yet
Development

No branches or pull requests

10 participants