@@ -78,9 +78,8 @@ export function updateValue(
78
78
vnode ,
79
79
{ emit = true , force = false , clean = false } = { }
80
80
) {
81
- const { config } = el [ CONFIG_KEY ]
82
- let { oldValue } = el [ CONFIG_KEY ]
83
- let currentValue = vnode && vnode . props ? vnode . props . value : el . value
81
+ let { config, oldValue } = el [ CONFIG_KEY ]
82
+ let currentValue = vnode ?. props ?. value || el . value
84
83
85
84
if ( force || oldValue !== currentValue ) {
86
85
const number = new NumberFormat ( config ) . clean ( clean && ! config . reverseFill )
@@ -98,7 +97,7 @@ export function updateValue(
98
97
}
99
98
}
100
99
101
- el [ CONFIG_KEY ] . oldValue = masked
100
+ el [ CONFIG_KEY ] . masked = masked
102
101
el . unmaskedValue = unmasked
103
102
104
103
// safari makes the cursor jump to the end if el.value gets assign even if to the same value
@@ -130,9 +129,9 @@ export function inputHandler(event) {
130
129
event . stopPropagation ( )
131
130
132
131
let positionFromEnd = target . value . length - target . selectionEnd
133
- const { oldValue, config } = target [ CONFIG_KEY ]
132
+ const { oldValue, config, masked } = target [ CONFIG_KEY ]
134
133
135
- updateValue ( target , null , { emit : false } , event )
134
+ updateValue ( target , null , { emit : false } )
136
135
137
136
// updated cursor position
138
137
positionFromEnd = Math . max ( positionFromEnd , config . suffix . length )
@@ -141,6 +140,7 @@ export function inputHandler(event) {
141
140
updateCursor ( target , positionFromEnd )
142
141
143
142
if ( oldValue !== target . value ) {
143
+ target [ CONFIG_KEY ] . oldValue = masked
144
144
target . dispatchEvent ( FacadeInputEvent ( ) )
145
145
}
146
146
}
@@ -157,12 +157,12 @@ export function blurHandler(event) {
157
157
if ( detail ?. facade ) {
158
158
return false
159
159
}
160
+ const { oldValue, masked } = target [ CONFIG_KEY ]
160
161
161
- const { oldValue } = target [ CONFIG_KEY ]
162
-
163
- updateValue ( target , null , { force : true , emit : true , clean : true } , event )
162
+ updateValue ( target , null , { force : true , emit : true , clean : true } )
164
163
165
164
if ( oldValue !== target . value ) {
165
+ target [ CONFIG_KEY ] . oldValue = masked
166
166
target . dispatchEvent ( FacadeChangeEvent ( ) )
167
167
}
168
168
}
0 commit comments