Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Error using v-mask function in vuetify component #530

Open
xmorelll opened this issue Sep 28, 2021 · 2 comments
Open

Error using v-mask function in vuetify component #530

xmorelll opened this issue Sep 28, 2021 · 2 comments

Comments

@xmorelll
Copy link

xmorelll commented Sep 28, 2021

V-mask function does not work in a vuetify v-text-field component. Apparently it generates some conflict with v-model.
When the v-model value is updated outside the input.

Versions:
"v-mask": "2.3.0"
"vue": "2.6.14"
"vuetify": "2.5.6"

<template>
  <div>
      <v-text-field
          v-model="value" 
          v-mask="mask"/>  
    <button @click="value=10" />
</div>
</template>

<script>
    methods: {
      mask: function(val: any) {
	        return [/[0-9]/, /[0-9]/]
        }
    },

</script>

What is Expected?

When the button is clicked the value should change to 10.

What is actually happening?

The value stays with the old value

I think this problem is similar to the issue: #500

@Yonier
Copy link

Yonier commented Nov 3, 2021

Having same issue with Vuetify and V-mask

@bjorntrondsen
Copy link

Ran into the same issue. Discussed in #518 as well.
Using a key is a workaround

data() {
  return {
    value: '',
    key: 0,
  }
},
<v-text-field v-model="value" v-mask="mask" :key="key"/>
<button @click="value=10;key++" />

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants