Skip to content

Commit 565e455

Browse files
committed
updated events
1 parent 88846a6 commit 565e455

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/core.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export function updateValue(el: CustomInputElement, vnode: VNode | null, { emit
120120
}
121121
}
122122

123-
el.masked = masked
123+
el.oldValue = masked
124124
el.unmaskedValue = unmasked
125125

126126
// safari makes the cursor jump to the end if el.value gets assign even if to the same value
@@ -151,8 +151,8 @@ export function inputHandler(event: CustomInputEvent) {
151151
// we can stop propagation of this native event
152152
event.stopPropagation()
153153

154-
const { oldValue, options } = target
155154
let positionFromEnd = target.value.length
155+
const { oldValue, options } = target
156156
if (target.selectionEnd) {
157157
positionFromEnd = target.value.length - target.selectionEnd
158158
}
@@ -185,12 +185,11 @@ export function blurHandler(event: Event) {
185185
return false
186186
}
187187

188-
const { oldValue, masked } = target
188+
const { oldValue } = target
189189

190190
updateValue(target, null, { force: true, emit: false, clean: true })
191191

192192
if (oldValue !== target.value) {
193-
target.oldValue = masked
194193
target.dispatchEvent(InputEvent('input'))
195194
}
196195
}

0 commit comments

Comments
 (0)