From 3fef668394cb788bd7a7b1887971df10e193bc4c Mon Sep 17 00:00:00 2001 From: Princi Vershwal Date: Thu, 14 Dec 2023 12:33:20 +0530 Subject: [PATCH] Validation fix: Corrected fields should revert back from error-state (#19376) Fixes PROD-278 --- .../src/components/settings/growth/offers/AddOfferModal.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/admin-x-settings/src/components/settings/growth/offers/AddOfferModal.tsx b/apps/admin-x-settings/src/components/settings/growth/offers/AddOfferModal.tsx index d56cd40a1b..3e2b014a65 100644 --- a/apps/admin-x-settings/src/components/settings/growth/offers/AddOfferModal.tsx +++ b/apps/admin-x-settings/src/components/settings/growth/offers/AddOfferModal.tsx @@ -492,12 +492,14 @@ const AddOfferModal = () => { let newOverrides = {...prevOverrides}; newOverrides.name = newValue; if (!prevOverrides.code.isDirty) { + clearError('code'); newOverrides.code = { ...prevOverrides.code, value: slugify(newValue) }; } if (!prevOverrides.displayTitle.isDirty) { + clearError('displayTitle'); newOverrides.displayTitle = { ...prevOverrides.displayTitle, value: newValue