Closed MaciejDybowski closed 10 months ago
Hi @MaciejDybowski, this is for sure a problem. But I'm facing an issue with this. Here are two use cases:
The problem is that the package cannot know which rule should run when. What I can do is to delay the validation after the country initialization: this would prevent the required message to show at init, but in fact when the user will change country before filling his phone number, the message will immediately show. So, a problem remains.
I currently don't have any "stable and safe" solution for this, so if you have any suggestion, those are welcome!
PS: I'm not facing the issue on my apps because I use validation-on="submit"
on my Vuetify <v-form>
.
i have the same issue as well
i found the solution maybe you as it fits me as well i using property validate-on='blur lazy' it made the input trigger error on blur the input and on submit as well example
After taking time to think about, I might came across a solution. Currently, everytime the country value change, the validation gets run (done by this line).
So a solution might be run validation function only when the phone input is filled. This would fix both problems.
This solution does not allow validating the country only changes, but does can be managed with the include/exclude countries props.
Hey @MaciejDybowski and @OmarHossamEldin, I released v4.1.1
with a fix for this issue :tada:
Feel free to comment/reopen if this is still an issue.
Expected Behavior
When I add additional validation functions, even if the simplest one is that the field is required I would like this validation to not run automatically and only at the time of the validate() function. Something along the lines of lazy-validation.
Because as far as validation during typing is concerned, as much as possible it should be auto/"live" during typing
Actual Behavior
Currently, as soon as you add the validation function required (1:1 from the documentation), the field lights up red
Steps to Reproduce the Problem
Specifications