uNmAnNeR / imaskjs

vanilla javascript input mask
https://imask.js.org
MIT License
4.96k stars 258 forks source link

Accept and Complete events are not fired in version 7 #1047

Closed sebestenyb closed 1 month ago

sebestenyb commented 5 months ago

Describe the bug Upgraded the package from 6. to 7., and the @accept and @complete events are not fired using directive. We use Vite (with Laravel) to package and chunk the JS code.

To Reproduce

// app.ts
import {IMaskDirective} from 'vue-imask';

app.directive("mask", IMaskDirective as Directive);
// Component.vue
    <input
        v-model="numberModel"
        v-mask="Number"
        radix="."
        :unmask="true"
        @accept="onAccept"
        @complete="onComplete"
    />
// Component.vue
const numberModel = ref('');

const onAccept = (event: CustomEvent) => {
    console.log(event)
}
const onComplete = (event: CustomEvent) => {
    console.log(event)
}
// npm
npm list vue-imask
trips@ ~/Sites/trips
└── vue-imask@7.6.1

Expected behavior We expect the events to be fired

We know it's not a lot of information, but we are in the dark here a bit, no errors, the mask works as it is supposed to work, masking the input, but the events are not fired. Any idea would be appreciated.

Environment:

Additional context Add any other context about the problem here.

bezuglyyvlad commented 2 months ago

I've also faced this problem. Mask is applied to value, but onAccept is not fired

guynikan commented 2 months ago

anyone?

uNmAnNeR commented 1 month ago

it seems working fine in my case: https://stackblitz.com/edit/vue-8qtd5w?file=src%2FApp.vue

feel free to reopen issue if you have more context about the problem