probil / v-mask

🔡 Tiny input mask library for Vue.js (directive)

Home Page:https://v-mask-demo.netlify.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Empty mask is always cleaning the input

alexandrejh opened this issue · comments

I've create a component what contains a mask prop, in the component I have an input with the v-mask directive binding mask to a prop, but when I use the component without mask, the field is always cleaned, accordinly my debugs the v-mask is trying to format my text with the mask and returning empty string.
My component is like this:


<template>
  <ValidationProvider
    :name="name"
    :rules="validate"
    v-slot="{ errors }"
    :vid="name"
  >
    <div>
      <label for="" class="vs-input--label" v-if="label">{{ label }}</label>
      <div>
        <input
          :type="type"
          :name="name"
          v-mask="mask"
          :value="value"
          :disabled="disabled"
        />
      </div>
    </div>
  </ValidationProvider>
</template>

<script>
export default {
  name: "my-component",
  data: function() {
    return {
      ...my data properties
    };
  },
  props: {
    label: {
      type: String,
      default: ""
    },
    type: {
      type: String,
      default: "text"
    },
    name: {
      type: String,
      default: ""
    },
    placeholder: {
      type: String,
      default: ""
    },
    validate: {
      type: String,
      default: ""
    },
    mask: {
      type: String,
      default: null
    },
    disabled: {
      type: Boolean,
      default: false
    },
    value: {
      type: String,
      default: ""
    },
  }
};
</script>

🎉 This issue has been resolved in version 2.2.3 🎉

The release is available on:

Your semantic-release bot 📦🚀