From 90cc0edcf4290cf8f460da443eba636a5fb73ea5 Mon Sep 17 00:00:00 2001 From: Teriuihi Date: Sun, 4 Aug 2024 23:21:05 +0200 Subject: [PATCH] Fix strict equality check in contact form input handler Updated the input change handler to use strict equality for comparing the previous and current length of the form value, ensuring more reliable condition checks and better handling of form state updates. --- src/components/contact_form/contact.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/contact_form/contact.tsx b/src/components/contact_form/contact.tsx index 5856e14..ca55453 100644 --- a/src/components/contact_form/contact.tsx +++ b/src/components/contact_form/contact.tsx @@ -120,7 +120,7 @@ const ContactForm = () => { as={(steps[currentStep].type === "textarea") ? "textarea" : "input"} onChange={(e: React.ChangeEvent) => { handleChange(e); - if (prevLength != values[steps[currentStep].name].length) { + if (prevLength !== values[steps[currentStep].name].length) { setFieldTouched(steps[currentStep].name); setPrevLength(values[steps[currentStep].name].length); }