File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
static/src/js/components/CustomRadioWidget Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -69,9 +69,8 @@ const CustomRadioWidget = ({
6969
7070 // Sets inputValue to input selected
7171 const handleChange = ( event ) => {
72- const { name } = event . target
73- const newValue = name === 'true'
74-
72+ const { id : targetId } = event . target
73+ const newValue = targetId . endsWith ( '-true' )
7574 onChange ( newValue )
7675 }
7776
@@ -100,7 +99,7 @@ const CustomRadioWidget = ({
10099 < input
101100 className = "d-flex form-check-input m-2"
102101 id = { `${ id } -true` }
103- name = " true"
102+ name = { ` ${ id } - true` } // Note: react-jsonschema-form requires these name properties to be unique.
104103 onChange = { handleChange }
105104 type = "radio"
106105 checked = { value === true }
@@ -114,8 +113,8 @@ const CustomRadioWidget = ({
114113 >
115114 < input
116115 className = "form-check-input m-2"
117- id = { `${ id } -false` }
118- name = " false"
116+ id = { `${ id } -false` } // Note: react-jsonschema-form requires these name properties to be unique.
117+ name = { ` ${ id } - false` }
119118 onChange = { handleChange }
120119 type = "radio"
121120 checked = { value === false }
You can’t perform that action at this time.
0 commit comments