mui / mui/material-ui

[FormControl] Flash of unselected styling on Form Label in a radio group

Open
#32,132 1 comment 1 reaction 1 assignee View on GitHub

Nobody has claimed this yet.

component: FormControl type: bug
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

Duplicates
  • I have searched the existing issues
Latest version
  • I have tested the latest version
Current behavior 😯

This affects the examples given in the documentation.

When using a FormLabel, RadioGroup and FormControlLabels, as per the documentation example:

<FormControl>
      <FormLabel id="demo-radio-buttons-group-label">Gender</FormLabel>
      <RadioGroup
        aria-labelledby="demo-radio-buttons-group-label"
        defaultValue="female"
        name="radio-buttons-group"
      >
        <FormControlLabel value="female" control={<Radio />} label="Female" />
        <FormControlLabel value="male" control={<Radio />} label="Male" />
        <FormControlLabel value="other" control={<Radio />} label="Other" />
      </RadioGroup>
    </FormControl>

Clicking the labels of the radio buttons will cause the FormLabel to briefly show the 'unselected' style.

Clicking the radio buttons themselves will not cause this issue.

Screen-Recording-2022-04-05-at-5 27 46-pm

Expected behavior 🤔

The flash should not occur.

Steps to reproduce 🕹

Steps:

  1. Visit: https://codesandbox.io/s/k1xmsu?file=/demo.js
  2. Click the radio button labels
  3. Note that the form label briefly turns grey.
Context 🔦

Jarring experience for forms.

Your environment 🌎

See sandbox.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.