Skip to content

Commit c202b38

Browse files
committed
updated core
1 parent bbb0fbd commit c202b38

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/core.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ export function updateValue(el: CustomInputElement, vnode: VNode | null, { emit
111111
}
112112
}
113113

114+
el.oldValue = masked
114115
el.masked = masked
115116
el.unmaskedValue = unmasked
116117

@@ -142,7 +143,7 @@ export function inputHandler(event: CustomInputEvent) {
142143
// we can stop propagation of this native event
143144
event.stopPropagation()
144145

145-
const { oldValue, options } = target
146+
const { oldValue, options, masked } = target
146147
let positionFromEnd = target.value.length
147148
if (target.selectionEnd) {
148149
positionFromEnd = target.value.length - target.selectionEnd
@@ -161,6 +162,7 @@ export function inputHandler(event: CustomInputEvent) {
161162
updateCursor(target, positionFromEnd)
162163

163164
if (oldValue !== target.value) {
165+
target.oldValue = masked
164166
target.dispatchEvent(InputEvent('input'))
165167
}
166168
}

0 commit comments

Comments
 (0)