@@ -56,20 +56,8 @@ export function setConfig(el: HTMLInputElement, config: any) {
5656 * Creates a CustomEvent('input') with detail = { facade: true }
5757 * used as a way to identify our own input event
5858 */
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 , {
7361 bubbles : true ,
7462 cancelable : true ,
7563 detail : { facade : true }
@@ -141,7 +129,7 @@ export function updateValue(el: CustomInputElement, vnode: VNode | null, { emit
141129
142130 // this part needs to be outside the above IF statement for vuetify in firefox
143131 // 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' ) )
145133 }
146134}
147135
@@ -182,7 +170,7 @@ export function inputHandler(event: CustomInputEvent) {
182170
183171 if ( oldValue !== target . value ) {
184172 target . oldValue = masked
185- target . dispatchEvent ( FacadeInputEvent ( ) )
173+ target . dispatchEvent ( InputEvent ( 'input' ) )
186174 }
187175}
188176
@@ -199,11 +187,11 @@ export function blurHandler(event: Event) {
199187
200188 const { oldValue, masked } = target
201189
202- updateValue ( target , null , { force : true , emit : true , clean : true } )
190+ updateValue ( target , null , { force : true , emit : false , clean : true } )
203191
204192 if ( oldValue !== target . value ) {
205193 target . oldValue = masked
206- target . dispatchEvent ( FacadeChangeEvent ( ) )
194+ target . dispatchEvent ( InputEvent ( 'change' ) )
207195 }
208196}
209197
0 commit comments