Skip to content

Commit

Permalink
fix(radio): pass all input props to custom icon render prop
Browse files Browse the repository at this point in the history
  • Loading branch information
abelflopes committed Oct 24, 2024
1 parent c8b34b2 commit 6596c01
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
14 changes: 2 additions & 12 deletions packages/components/_provisional/src/boolean-input/BooleaInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ export const BooleaInput = ({
skin,
className,
id,
checked,
value,
name,
...otherProps
}: Readonly<BooleaInputProps>): React.ReactElement => {
const formFieldContext = useFormFieldContext();
Expand All @@ -25,16 +22,9 @@ export const BooleaInput = ({

return (
<span className={classNames(styles.root, className)}>
<input
{...otherProps}
id={computedId}
name={name}
checked={checked}
value={value}
className={styles.input}
/>
<input {...otherProps} id={computedId} className={styles.input} />

<Icon name={name} value={value} skin={skin ?? formFieldContext?.skin} />
<Icon {...otherProps} skin={skin ?? formFieldContext?.skin} />
</span>
);
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type FormFieldContextProps } from "@react-ck/form-field";
import { type ComponentProps } from "react";

interface BaseProps extends Required<Pick<ComponentProps<"input">, "name" | "value">> {
interface BaseProps extends ComponentProps<"input"> {
skin: FormFieldContextProps["skin"];
}

Expand Down

0 comments on commit 6596c01

Please sign in to comment.