mirror of
https://github.com/tenrok/maska.git
synced 2026-06-11 18:02:27 +03:00
Fix eager mask bug #128
This commit is contained in:
+2
-5
@@ -105,16 +105,13 @@ export class MaskInput {
|
||||
let value = valueOld
|
||||
|
||||
if (mask.isEager()) {
|
||||
const masked = mask.masked(valueOld)
|
||||
const unmasked = mask.unmasked(valueOld)
|
||||
const maskedUnmasked = mask.masked(unmasked)
|
||||
|
||||
if (unmasked === '' && 'data' in e && e.data != null) {
|
||||
// empty state and something like `space` pressed
|
||||
value = e.data
|
||||
} else if (
|
||||
maskedUnmasked.startsWith(valueOld) ||
|
||||
mask.completed(unmasked)
|
||||
) {
|
||||
} else if (unmasked !== mask.unmasked(masked)) {
|
||||
value = unmasked
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user