From 536f915c69bf1c614d73372ebc9b2f2d681ae2d5 Mon Sep 17 00:00:00 2001 From: Danel Kungla Date: Thu, 14 Aug 2025 09:24:20 +0300 Subject: [PATCH] fix: ensure form resets and button state reflects dirty status --- .../[account]/billing/_components/health-benefit-form.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/home/[account]/billing/_components/health-benefit-form.tsx b/app/home/[account]/billing/_components/health-benefit-form.tsx index a247f92..ba654ea 100644 --- a/app/home/[account]/billing/_components/health-benefit-form.tsx +++ b/app/home/[account]/billing/_components/health-benefit-form.tsx @@ -43,6 +43,7 @@ const HealthBenefitForm = ({ amount: currentCompanyParams.benefit_amount || 0, }, }); + const isDirty = form.formState.isDirty; const onSubmit = (data: { occurance: string; amount: number }) => { const promise = async () => { @@ -55,6 +56,7 @@ const HealthBenefitForm = ({ benefit_occurance: data.occurance, })); } finally { + form.reset(data); setIsLoading(false); } }; @@ -83,7 +85,11 @@ const HealthBenefitForm = ({

-