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.
This commit is contained in:
parent
7ab9e25eb5
commit
90cc0edcf4
|
|
@ -120,7 +120,7 @@ const ContactForm = () => {
|
|||
as={(steps[currentStep].type === "textarea") ? "textarea" : "input"}
|
||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user