#Is it possible to prevent onBlur on a specific field when using Conform validate: 'onBlur'?

1 messages · Page 1 of 1 (latest)

fathom locust
#

I have a remix fetcher form, that I want to validate all fields but one onBlur, and for the one field I need to handle a bit differently so I would like to prevent validation on that field onBlur, but instead it needs to validate when some state exists.

kindred spruce
#

What tool are you using for validation, I'm thinking Zod may be able to help here, so it validates based off another value in the form, which could get controlled by state? Either that or switch validation schemas, based off the state?

fathom locust
#

conform / zod

lusty tulip
#

You should be able to do onBlur={(event) => event.stopPropagation()} on the specific input

#

event.preventDefault() might also work there, I forget if that always stops propagation on its own