Skip to content

Radio: Add required prop to RadioGroup#22809

Merged
spmonahan merged 1 commit intomicrosoft:masterfrom
spmonahan:radio/radio-group-required
May 3, 2022
Merged

Radio: Add required prop to RadioGroup#22809
spmonahan merged 1 commit intomicrosoft:masterfrom
spmonahan:radio/radio-group-required

Conversation

@spmonahan
Copy link
Contributor

@spmonahan spmonahan commented May 3, 2022

Current Behavior

RadioGroup lacks a required prop so each individual child Radio must set its required prop to make a group required.

New Behavior

RadioGroup has a required prop that is passed down to all child Radios via context.

Related Issue(s)

Fixes #22766

@codesandbox-ci
Copy link

codesandbox-ci bot commented May 3, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 0a5b55b:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@fabricteam
Copy link
Collaborator

fabricteam commented May 3, 2022

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-radio
Radio
23.534 kB
7.892 kB
29.382 kB
10.047 kB
5.848 kB
2.155 kB
react-radio
RadioGroup
8.205 kB
3.516 kB
13.61 kB
5.462 kB
5.405 kB
1.946 kB

🤖 This report was generated against f542a2a06d0b71bb5c9bd19fed0a8c08ee6b2b0f

@size-auditor
Copy link

size-auditor bot commented May 3, 2022

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: 9132814df4b6d40d1f5d93d8324d756c1284b294 (build)

@fabricteam
Copy link
Collaborator

fabricteam commented May 3, 2022

Perf Analysis (@fluentui/react-components)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 1094 1054 5000
Button mount 673 666 5000
FluentProvider mount 2241 2274 5000
FluentProviderWithTheme mount 358 333 10
FluentProviderWithTheme virtual-rerender 287 274 10
FluentProviderWithTheme virtual-rerender-with-unmount 367 366 10
MakeStyles mount 1895 1877 50000

Adds a `required` prop to `RadioGroup` that is passed down to all child
`Radio`s via context. Previously a user had to set `required` on each
child `Radio` which was a lot of extra typing plus it opened the
component up to easy misuse -- it doesn't make sense for a single radio
in a group to be required and not others.
@spmonahan spmonahan force-pushed the radio/radio-group-required branch from c4d3d29 to 0a5b55b Compare May 3, 2022 23:23
@spmonahan spmonahan merged commit 6a017c3 into microsoft:master May 3, 2022
marwan38 pushed a commit to marwan38/fluentui that referenced this pull request Jun 13, 2022
Adds a `required` prop to `RadioGroup` that is passed down to all child
`Radio`s via context. Previously a user had to set `required` on each
child `Radio` which was a lot of extra typing plus it opened the
component up to easy misuse -- it doesn't make sense for a single radio
in a group to be required and not others.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RadioGroup: add required prop

5 participants