feat: urgent fix for react-hook-fork

This commit is contained in:
Nevo David 2025-05-16 12:25:58 +07:00
parent 23de5530e7
commit 987caabac3
3 changed files with 510 additions and 512 deletions

View File

@ -312,6 +312,10 @@ export default withProvider(
return 'Tiktok items should be one';
}
if (firstItems.length === 0) {
return 'No video / images selected';
}
if (
firstItems.length > 1 &&
firstItems?.some((p) => p?.path?.indexOf('mp4') > -1)

View File

@ -1,6 +1,6 @@
'use client';
import { DetailedHTMLProps, FC, SelectHTMLAttributes, useMemo } from 'react';
import { DetailedHTMLProps, FC, forwardRef, SelectHTMLAttributes, useMemo } from 'react';
import { clsx } from 'clsx';
import { useFormContext } from 'react-hook-form';
import interClass from '../helpers/inter.font';
@ -18,7 +18,7 @@ export const Select: FC<
name: string;
hideErrors?: boolean;
}
> = (props) => {
> = forwardRef((props, ref) => {
const {
label,
className,
@ -39,6 +39,7 @@ export const Select: FC<
<div className={clsx("flex flex-col", label ? 'gap-[6px]' : '')}>
<div className={`${interClass} text-[14px]`}>{label}</div>
<select
ref={ref}
{...(disableForm ? {} : form.register(props.name, extraForm))}
className={clsx(
'bg-input h-[44px] px-[16px] outline-none border-fifth border rounded-[4px] text-inputText placeholder-inputText',
@ -51,4 +52,4 @@ export const Select: FC<
)}
</div>
);
};
});