2
0
mirror of https://github.com/tenrok/maska.git synced 2026-06-05 16:42:28 +03:00

Fix bug with hooks order

This commit is contained in:
Alexander Shabunevich
2023-01-21 12:29:09 +03:00
parent c053e4d888
commit b97c7c3165
2 changed files with 241 additions and 34 deletions
+6 -6
View File
@@ -144,6 +144,12 @@ export class MaskInput {
value = mask.masked(value)
const detail = {
masked: mask.masked(value),
unmasked: mask.unmasked(value),
completed: mask.completed(value)
}
if (this.options.postProcess != null) {
value = this.options.postProcess(value)
}
@@ -151,12 +157,6 @@ export class MaskInput {
input.value = value
input.dataset.maskaValue = value
const detail = {
masked: mask.masked(value),
unmasked: mask.unmasked(value),
completed: mask.completed(value)
}
if (this.options.onMaska != null) {
if (Array.isArray(this.options.onMaska)) {
this.options.onMaska.forEach((f) => f(detail))