change props children in input

This commit is contained in:
honzapatCZ 2025-03-31 11:24:49 +02:00
parent f082308d5d
commit b46be19a22

View File

@ -25,8 +25,9 @@ export default function Input(
} }
) { ) {
/*name, id*/ /*name, id*/
let { children, ...otherProps } = props;
const [field, meta, helpers] = useField(props); const [field, meta, helpers] = useField(otherProps);
return ( return (
<div css={[props.title && tw`my-1`, tw`relative`]} className={props.className}> <div css={[props.title && tw`my-1`, tw`relative`]} className={props.className}>
@ -43,7 +44,7 @@ export default function Input(
{/*name={name || title} id={id || name || title}*/} {/*name={name || title} id={id || name || title}*/}
<input <input
id={props.id ?? props.name ?? props.title} id={props.id ?? props.name ?? props.title}
{...props} {...otherProps}
{...field} {...field}
tw="bg-primary appearance-none border-2 border-secondary rounded w-full py-2 px-4 text-primary leading-tight focus:outline-none focus:bg-secondary focus:border-accent transition duration-150 " tw="bg-primary appearance-none border-2 border-secondary rounded w-full py-2 px-4 text-primary leading-tight focus:outline-none focus:bg-secondary focus:border-accent transition duration-150 "
/> />