You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I am trying to add validate for some dependent validation in textField/string which is under listField and even outside, I noticed that validate function in not working. I saw same issue in your storybook too.
To Reproduce
Steps to reproduce the behavior:
Existing issue in storybook example:
Click on 'try to submit password & confirmPassword without match'
Notice the error is not displayed
Put console.log in validate in local, validate doesnt trigger
Issue in my schema(test):
I am using below create function to create my formAtom object and binding to respective tsx
// fieldsAtom creator// This function is used to have isolated scopeexportconstfieldsCreatorTierConditions=()=>{constunit=stringField({value: Unit.QUANTITY,preprocess(value){returnvalue;},name: 'unit',validate: ({ get, event, value })=>{debugger;console.info('UNIT:Validation: THIS IS NOT TRIGGERING');},});constvalues=listField({validate: ({ get, event, value })=>{debugger;console.info('ListField:VALIDATION, this is not triggering where as listAtom works but not on Onchange of any fields in listAtom');console.info('list Validate:',value);return['what an error','yeah its fine'];},value: [{min: '',max: ''},{min: '',max: ''},{min: '',max: ''},],fields: ({ min ='', max =''})=>({min: stringField({name: 'min',value: min,schema: z.string().min(1),validate: ({ get, event, value })=>{debugger;console.log('min:validation: this is also not working,/triggering');},}),max: stringField({name: 'max',validate: ({ get, event, value })=>{debugger;console.log('max:validation: this is also not working,/triggering');},value: max,}),}),});return{ unit, values };};
to achieve this
validate never fires with and without schema.
3
Expected behavior
In both the above examples, I would like to see validate does its work. If schema cannot exist when validate exist then it should be clearly mentioned. Even without schema, validate should first work. Please provide some example or provide help.
Screenshots
Existing Issue:
Desktop (please complete the following information):
OS: [e.g. iOS]
Browser [e.g. chrome, safari]
Version [e.g. 22]
Smartphone (please complete the following information):
Device: [e.g. iPhone6]
OS: [e.g. iOS8.1]
Browser [e.g. stock browser, safari]
Version [e.g. 22]
Additional context
I think we need to have enough complex examples to test / view in storybook
The text was updated successfully, but these errors were encountered:
The reason is that the zodField controls the function with the required/optional API. If we would use the validate config option, the purpose of zodField is lost. So if you need the custom validation beyond what the schema config option offers, you need to use the fieldAtom itself. You don't need zodField in that case.
Describe the bug
I am trying to add validate for some dependent validation in textField/string which is under listField and even outside, I noticed that validate function in not working. I saw same issue in your storybook too.
To Reproduce
Steps to reproduce the behavior:
Existing issue in storybook example:
Issue in my schema(test):
to achieve this
3
Expected behavior
In both the above examples, I would like to see validate does its work. If schema cannot exist when validate exist then it should be clearly mentioned. Even without schema, validate should first work. Please provide some example or provide help.
Screenshots
Existing Issue:
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
I think we need to have enough complex examples to test / view in storybook
The text was updated successfully, but these errors were encountered: