File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,7 @@ export type TaintOption<T extends AnyZodObject = AnyZodObject> =
203203 | boolean
204204 | 'untaint'
205205 | 'untaint-all'
206+ | 'ignore'
206207 | { fields : FormPathLeaves < z . infer < T > > | FormPathLeaves < z . infer < T > > [ ] } ;
207208
208209type SuperFormData < T extends ZodValidation < AnyZodObject > > = {
@@ -695,6 +696,11 @@ export function superForm<
695696 compareAgainst : unknown ,
696697 taintOptions : TaintOption < UnwrappedT >
697698 ) {
699+ // Ignore is set when returning errors from the server
700+ // so status messages and form-level errors won't be
701+ // immediately cleared by client-side validation.
702+ if ( taintOptions == 'ignore' ) return ;
703+
698704 let paths = comparePaths ( newObj , compareAgainst ) ;
699705
700706 if ( typeof taintOptions === 'object' ) {
@@ -803,7 +809,7 @@ export function superForm<
803809 // Form data is not tainted when rebinding.
804810 // Prevents object errors from being revalidated after rebind.
805811 // eslint-disable-next-line dci-lint/private-role-access
806- Form . set ( form . data , { taint : false } ) ;
812+ Form . set ( form . data , { taint : 'ignore' } ) ;
807813 Message . set ( message ) ;
808814 Errors . set ( form . errors ) ;
809815 FormId . set ( form . id ) ;
You can’t perform that action at this time.
0 commit comments