Skip to content

Conversation

@icebob
Copy link
Member

@icebob icebob commented Oct 11, 2017

New formOption validateDebounceTime to debouncing the validate method:

{
    model: {
        name: "",
    },

    schema: {
        fields: [
            {
                type: "input",
                inputType: "text",
                label: "Name",
                model: "name",
                    validator: function(value, field, model){
                    return new Promise(resolve => {
                        setTimeout(() => {
                            if (value === "valid")
                                return resolve([]);

                            resolve([`invalid name: "${value}"`]);
                        }, 500);
                    });
                }
            }
        ]
    },

    formOptions: {
            validateAfterChanged: true,
            validateDebounceTime: 500
    }
}

@icebob icebob merged commit 71dd34a into master Oct 12, 2017
@icebob icebob deleted the debounce-validate branch October 12, 2017 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants