Skip to content

Why is there throttling on validateField #1724

@stefanve

Description

@stefanve

I have a big schema and has splitted the form in parts for easier fill in/overview. That means that I cannot use validateForm, but instead validate each field.

I do (basically) :

Object.keys(AutoForm.getFormValues(formId).insertDoc) => (f){
    if(!(AutoForm.validateField(formId, f))){
          //handle error
        }
}

This works well if I step through it in the debugger, but when run normally, validateField returns true whatever the reality is.

Am I missing some logic here? Why is the throttle there? Is my approach unique and wrong?

From the package code:

// Throttle field validation to occur at most every 300ms,
// with leading and trailing calls.
export const validateField = throttle(_validateField, 300)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions