Skip to content

Commit 5d45f7e

Browse files
committed
[Fix] Mutation issue
1 parent 4e2c902 commit 5d45f7e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/core.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,11 @@ export function inputHandler(event: CustomInputEvent) {
146146
return false
147147
}
148148

149-
const { oldValue, options, masked } = target
150-
151149
// since we will be emitting our own custom input event
152150
// we can stop propagation of this native event
153151
event.stopPropagation()
152+
153+
const { oldValue, options } = target
154154
let positionFromEnd = target.value.length
155155
if (target.selectionEnd) {
156156
positionFromEnd = target.value.length - target.selectionEnd
@@ -169,7 +169,7 @@ export function inputHandler(event: CustomInputEvent) {
169169
updateCursor(target, positionFromEnd)
170170

171171
if (oldValue !== target.value) {
172-
target.oldValue = masked
172+
// target.oldValue = masked
173173
target.dispatchEvent(InputEvent('input'))
174174
}
175175
}
@@ -191,7 +191,7 @@ export function blurHandler(event: Event) {
191191

192192
if (oldValue !== target.value) {
193193
target.oldValue = masked
194-
target.dispatchEvent(InputEvent('change'))
194+
target.dispatchEvent(InputEvent('input'))
195195
}
196196
}
197197

0 commit comments

Comments
 (0)