Skip to content

Commit 7ab8c74

Browse files
authored
Merge pull request #9025 from marmelab/fix-radiobuttoingroupinput-id
Fix RadioButtonGroupInput does not honor id prop in option labels
2 parents b86ecce + 2e08b27 commit 7ab8c74

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

packages/ra-ui-materialui/src/input/RadioButtonGroupInput.stories.tsx

+19
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,25 @@ export const InsideReferenceArrayInputWithError = () => (
113113
</AdminContext>
114114
);
115115

116+
export const Id = () => (
117+
<>
118+
<Wrapper>
119+
<RadioButtonGroupInput
120+
id="foo"
121+
source="category"
122+
choices={choices}
123+
row={false}
124+
/>
125+
</Wrapper>
126+
<Wrapper>
127+
<RadioButtonGroupInput
128+
source="category"
129+
choices={choices}
130+
row={false}
131+
/>
132+
</Wrapper>
133+
</>
134+
);
116135
const i18nProvider = polyglotI18nProvider(() => englishMessages);
117136

118137
const Wrapper = ({ children }) => (

packages/ra-ui-materialui/src/input/RadioButtonGroupInput.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export const RadioButtonGroupInput = (props: RadioButtonGroupInputProps) => {
191191
choice={choice}
192192
optionText={optionText}
193193
optionValue={optionValue}
194-
source={source}
194+
source={id}
195195
translateChoice={translateChoice}
196196
/>
197197
))}

0 commit comments

Comments
 (0)