Paste using inputmask #3413
Unanswered
lucraraujo
asked this question in
Q&A
Replies: 1 comment
-
So, the solution I found to make it work was this: Vue.directive('some-mask', {
bind (el) {
const input = el.querySelector('input')
new Inputmask('9999-99.9').mask(input)
input.addEventListener('paste', (event) => {
input.value = event.clipboardData.getData('text')
input.dispatchEvent(new Event('input', { bubbles: true }))
})
}
}) Do someone know a more elegant way to do that? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to Inputmask to mask my inputs.
The problem I'm facing is that, when I paste some value in the input, the is not updated in the model.
Beta Was this translation helpful? Give feedback.
All reactions