diff --git a/src/app/(main)/websites/[websiteId]/(reports)/funnels/FunnelEditForm.tsx b/src/app/(main)/websites/[websiteId]/(reports)/funnels/FunnelEditForm.tsx index 30976bff7..13712f2ad 100644 --- a/src/app/(main)/websites/[websiteId]/(reports)/funnels/FunnelEditForm.tsx +++ b/src/app/(main)/websites/[websiteId]/(reports)/funnels/FunnelEditForm.tsx @@ -56,7 +56,7 @@ export function FunnelEditForm({ const defaultValues = { name: data?.name || '', window: data?.parameters?.window || 60, - steps: data?.parameters?.steps || [{ type: 'path', value: '/' }], + steps: data?.parameters?.steps || [{ type: 'path', value: '' }], }; return ( @@ -82,12 +82,10 @@ export function FunnelEditForm({ validate: value => value.length > 1 || 'At least two steps are required', }} > - {({ fields, append, remove, getValues }) => { + {({ fields, append, remove }) => { return ( {fields.map(({ id }: { id: string }, index: number) => { - const type = getValues(`steps.${index}.type`); - return ( @@ -103,7 +101,8 @@ export function FunnelEditForm({ name={`steps.${index}.value`} rules={{ required: formatMessage(labels.required) }} > - {({ field }) => { + {({ field, context }) => { + const type = context.watch(`steps.${index}.type`); return ; }} @@ -118,7 +117,7 @@ export function FunnelEditForm({ })}