Skip to content

Commit

Permalink
Move transferProps back from fieldset to input in RadioField (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
bedrich-schindler committed Oct 17, 2023
1 parent 5ca5a06 commit 21e4715
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/components/Radio/Radio.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export const Radio = ({

return (
<fieldset
{...transferProps(restProps)}
className={classNames(
styles.root,
context && styles.isRootInFormLayout,
Expand Down Expand Up @@ -68,17 +67,14 @@ export const Radio = ({
key={key}
>
<input
{...transferProps(restProps)}
checked={restProps.onChange
? (value === option.value) || false
: undefined}
className={styles.input}
disabled={disabled || option.disabled}
id={id && `${id}__item__${key}`}
name={id}
// The change is handled by the `<fieldset>` element. This is a placeholder to prevent React from
// showing the warning about uncontrolled input: "You provided a `checked` prop to a form field
// without an `onChange` handler."
onChange={() => {}}
type="radio"
value={option.value}
/>
Expand Down

0 comments on commit 21e4715

Please sign in to comment.