Skip to content

Revalidate model after successful custom validation event broadcasted #642

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

cepauskas
Copy link

Description

Custom validation of input fails if event of successful validation is broadcasted after input validation is executed in onChange method (for example custom validation takes some time - timeout, async request etc.).

Reproduce

Enter "yzy" as name, wait a second till custom validation with timeout will ran (you will get "exists" error message). Enter one more character wait one more second. Input will be marked as invalid although it is valid.

https://jsfiddle.net/t1a8nhop/

Fix relates with issues

#577
#637
#440

Anthropic added a commit that referenced this pull request Mar 9, 2016
…ustom_validation

Revalidate model after successful custom validation event broadcasted
@Anthropic Anthropic merged commit 948c6cc into json-schema-form:development Mar 9, 2016
@cepauskas
Copy link
Author

Thanks!

@Anthropic
Copy link
Member

@cepauskas, no, thank you for your efforts to help, the more the better, sorry it took so long we are going through some changes and there will be major updates to this framework in the not too distant future :)

@ss-bb
Copy link

ss-bb commented Mar 11, 2016

Hi guys.
I have compile the current development version with the modification, it didn't correct the error for me.
Can someone confirm that building the dev branch work for him/her ? Thank.

@cepauskas
Copy link
Author

Do you configure properly form? You have to set ngModelOptions: { allowInvalid: true }, that custom error broadcasting would work.

       "items": [{
          key: "name",
          onChange: 'onNameChange(modelValue, form)',
          ngModelOptions: {
            allowInvalid: true
          }
        }]

@ss-bb
Copy link

ss-bb commented Mar 14, 2016

sorry I miss-understand your exemple. I'm using asyncValidator on the field.
I will raise a new issue for this.

@raoulus
Copy link

raoulus commented Mar 23, 2016

It would be great if you could create a new release for this fix. When do you plan to get it out?

Thx

@Anthropic
Copy link
Member

@raoulus I will do a build this weekend.

@Anthropic
Copy link
Member

I wanted to know the code better myself first, and finally look like having some time. :)

@raoulus
Copy link

raoulus commented Mar 23, 2016

Cool, looking forward!

@raoulus
Copy link

raoulus commented Mar 30, 2016

@Anthropic what about the release? :)

@Anthropic
Copy link
Member

@raoulus another pull I accepted had another pull added and I needed some clarification on the previous steps taken for this project, so it had to wait, but it will be this week/weekend :)

@Anthropic
Copy link
Member

@raoulus @cepauskas 0.8.13 is now in bower and the npm release will follow by tomorrow

Anthropic added a commit that referenced this pull request May 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants