Skip to content

Bug: Controlled radio with uppercase type (e.g. type="RADIO") is not restored after click #38163

Description

@lunaxislu

Controlled radio buttons whose type is not all lowercase (e.g. type="Radio" or type="RADIO") do not get restored to their controlled checked state after a click. HTML input types are case-insensitive and the browser treats these as normal radio buttons (input.type === 'radio'), but React skips restoring the other radios in the group. As a result, the DOM no longer matches React state.

React version: 19.3.1 (react and react-dom)

Steps To Reproduce

  1. Render two controlled radio buttons in the same group with type="RADIO", where state keeps A selected and onChange does not change state.
  2. Click B.

Link to code example:

import {useState} from 'react';

function App() {
  const [value] = useState('A');

  return ['A', 'B'].map(option => (
    <label key={option}>
      <input
        type="RADIO"
        name="plan"
        checked={value === option}
        onChange={() => {
          // Intentionally do not update state (e.g. the user cancelled a confirm dialog).
        }}
      />
      {option}
    </label>
  ));
}

Results in Chrome after clicking B:

type A / B checked after clicking B
radio true / false
Radio false / false
RADIO false / false

The current behavior

With type="Radio" or type="RADIO", both A and B end up unchecked, even though state still selects A.

The expected behavior

Same as type="radio": B is unchecked and A stays checked, matching React state.

restoreControlledInputState in ReactDOMInput.js checks props.type === 'radio', so the group restoration is skipped when the prop is not lowercase. A fix using the browser-normalized rootNode.type is proposed in #38162.

Activity

  1. omerfarukgurbuz commented on Nov 9, 2026

    @omerfarukgurbuz

    This also affects native form serialization. I put the two controlled radios in a form with value={option} and left the change handler as a no-op. In React DOM 19.3.1 with jsdom, after clicking B with type="RADIO", new FormData(form).get('plan') returned null, even though the React selection was still A.

    For apps that get input types from a schema, normalize the string before passing it to React (type={field.type.toLowerCase()}), or use the literal type="radio" in the radio renderer. With that normalization the change handler still fired once, A stayed checked, and FormData returned 'A'. Checking the serialized value would also make a useful end-to-end assertion for #38162.

  2. lunaxislu commented on Nov 10, 2026

    @lunaxislu
    Author

    @omerfarukgurbuz
    Thanks for checking and highlighting the form serialization impact! This is consistent with the same checked-state restoration bug. The regression test in #38162 directly checks that A remains checked and B is unchecked after the click, which should also cover the underlying state that form serialization depends on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ Proxy