Reading conditional fields OPTIONS in Yup

Viewed 20

I have a question about Yup. We've recently implemented some kind of "character counter" next to our input field. Basically a counter that lets you know when your field has reached max length and also stops the user from inserting any more characters inside the input.

In order to know the exact max length number, our program simply reads the schema object and finds the OPTIONS field inside the target field's validation which contains the "maxLength" variable.

However, the issue is that conditional fields aren't shown inside the schema object when reading with console.log or when using describe(). This means that things like the max length option can't be read inside a conditional field even if the condition itself has been met and the max length validation per se works.

Is there any way to read the OPTIONS field of the conditional fields present inside a schema?

0 Answers
Related