2
0
mirror of https://github.com/tenrok/maska.git synced 2026-06-11 18:02:27 +03:00

Fix #38: work with vuetify

This commit is contained in:
Alexander Shabunevich
2021-07-22 23:01:55 +03:00
parent 0355016b35
commit 622316e5c3
9 changed files with 17 additions and 15 deletions
+3 -1
View File
@@ -50,6 +50,8 @@ export default class Maska {
}
updateValue (el, evt) {
if (!el || !el.type) return
const wrongNum = el.type.match(/^number$/i) && el.validity.badInput
if ((!el.value && !wrongNum) || !el.dataset.mask) {
el.dataset.maskRawValue = ''
@@ -76,7 +78,7 @@ export default class Maska {
}
beforeInput (e) {
if (e.target.type.match(/^number$/i) && e.data && isNaN(e.target.value + e.data)) {
if (e && e.target && e.target.type && e.target.type.match(/^number$/i) && e.data && isNaN(e.target.value + e.data)) {
e.preventDefault()
}
}