Skip to content

Commit

Permalink
Temporary fix for rjsf-team#349 and facebook/react#7630 radio widget bug
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenth committed Nov 25, 2016
1 parent a3f3e9d commit bafa79d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/widgets/RadioWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ function RadioWidget({
// Generating a unique field name to identify this set of radio buttons
const name = Math.random().toString();
const {enumOptions, inline} = options;
// checked={checked} has been moved above name={name}, As mentioned in #349;
// this is a temporary fix for radio button rendering bug in React, facebook/react#7630.
return (
<div className="field-radio-group">{
enumOptions.map((option, i) => {
Expand All @@ -21,9 +23,9 @@ function RadioWidget({
const radio = (
<span>
<input type="radio"
checked={checked}
name={name}
value={option.value}
checked={checked}
disabled={disabled}
autoFocus={autofocus && i === 0}
onChange={_ => onChange(option.value)}/>
Expand Down

0 comments on commit bafa79d

Please sign in to comment.