@@ -56,20 +56,8 @@ export function setConfig(el: HTMLInputElement, config: any) {
56
56
* Creates a CustomEvent('input') with detail = { facade: true }
57
57
* used as a way to identify our own input event
58
58
*/
59
- export function FacadeInputEvent ( ) {
60
- return new CustomEvent ( 'input' , {
61
- bubbles : true ,
62
- cancelable : true ,
63
- detail : { facade : true }
64
- } )
65
- }
66
-
67
- /**
68
- * Creates a CustomEvent('change') with detail = { facade: true }
69
- * used as a way to identify our own change event
70
- */
71
- export function FacadeChangeEvent ( ) {
72
- return new CustomEvent ( 'change' , {
59
+ export function InputEvent ( type : string ) {
60
+ return new CustomEvent ( type , {
73
61
bubbles : true ,
74
62
cancelable : true ,
75
63
detail : { facade : true }
@@ -141,7 +129,7 @@ export function updateValue(el: CustomInputElement, vnode: VNode | null, { emit
141
129
142
130
// this part needs to be outside the above IF statement for vuetify in firefox
143
131
// drawback is that we endup with two's input events in firefox
144
- return emit && el . dispatchEvent ( FacadeInputEvent ( ) )
132
+ return emit && el . dispatchEvent ( InputEvent ( 'input' ) )
145
133
}
146
134
}
147
135
@@ -182,7 +170,7 @@ export function inputHandler(event: CustomInputEvent) {
182
170
183
171
if ( oldValue !== target . value ) {
184
172
target . oldValue = masked
185
- target . dispatchEvent ( FacadeInputEvent ( ) )
173
+ target . dispatchEvent ( InputEvent ( 'input' ) )
186
174
}
187
175
}
188
176
@@ -199,11 +187,11 @@ export function blurHandler(event: Event) {
199
187
200
188
const { oldValue, masked } = target
201
189
202
- updateValue ( target , null , { force : true , emit : true , clean : true } )
190
+ updateValue ( target , null , { force : true , emit : false , clean : true } )
203
191
204
192
if ( oldValue !== target . value ) {
205
193
target . oldValue = masked
206
- target . dispatchEvent ( FacadeChangeEvent ( ) )
194
+ target . dispatchEvent ( InputEvent ( 'change' ) )
207
195
}
208
196
}
209
197
0 commit comments