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

A field required with Vuelidate that also has a mask gets highlighted immediately. #2

Closed
ghost opened this issue Sep 19, 2019 · 1 comment

Comments

@ghost
Copy link

ghost commented Sep 19, 2019

After upgrading to Vuetify 2 and using your v-mask to replace the old mask I noticed an issue. We use Vuelidate for form validation and when a field has both a mask and is required it gets highlighted in red immediately.

Any help would be greatly appreciated.


Demo repo: v-mask-required (deleted)

The demo shows a comparison between 4 types of required fields. Note how only the Vuelidate required and masked field is prematurely highlighted.


Here's my shot in the dark at what the problem might be.
I'm thinking the field is being touched by the directive unnecessarily.
Maybe a simple fix could be something like this:

if (inputValue !== maskedValue) {
  inputValue = maskedValue;
}

After all there shouldn't be a need to touch the value of the input if it hasn't changed.

@titou10titou10
Copy link
Owner

Done (v1.0.5)
Thanks for reporting and for your test repository!

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

No branches or pull requests

1 participant