Skip to content
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

Configure default validation trigger #535

Closed
RomkeVdMeulen opened this issue Oct 1, 2019 · 3 comments · Fixed by #536
Closed

Configure default validation trigger #535

RomkeVdMeulen opened this issue Oct 1, 2019 · 3 comments · Fixed by #536

Comments

@RomkeVdMeulen
Copy link
Contributor

I'm submitting a feature request

Current behavior:
By default validation is triggered onChange and onBlur, according to the docs (although the ValidationController sets the trigger to blur by default: is the doc out of date?). These default triggers are baked in and can only be overridden case by case by using a different binding behavior or changing the ValidationController's validateTrigger after injection.

Expected/desired behavior:
I'd like to be able to specify the default validation triggers for my entire app rather than on an individual binding level.

What is the motivation / use case for changing the behavior?
After reading that validating input as the user types, or on blur, can be problematic I tried to switch all validation in my app at once to only validate on submit. So far as I can tell, the only way to achieve this is to replace each & validate binding behavior with & validateOnBlur or to set each ValidationController's validateTrigger to manual after injection. I'd like to be able to configure this once at plugin registration.

@bigopon
Copy link
Member

bigopon commented Oct 1, 2019

@RomkeVdMeulen This feature sounds nice, and doesn't sound hard to achieve. Wanna give it a go? Would be awesome if we could have some help ❤️

@RomkeVdMeulen
Copy link
Contributor Author

I'd love to, but I'm a bit swamped and I have a project next week, so it won't be before the 14th.

@RomkeVdMeulen
Copy link
Contributor Author

@bigopon Could you take a look at the PR? I think it should be ready to be merged in.

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 a pull request may close this issue.

2 participants