@@ -10,7 +10,7 @@ export function FacadeInputEvent() {
1010 return new CustomEvent ( 'input' , {
1111 bubbles : true ,
1212 cancelable : true ,
13- detail : { facade : true }
13+ detail : { facade : true } ,
1414 } )
1515}
1616
@@ -22,7 +22,7 @@ export function FacadeChangeEvent() {
2222 return new CustomEvent ( 'change' , {
2323 bubbles : true ,
2424 cancelable : true ,
25- detail : { facade : true }
25+ detail : { facade : true } ,
2626 } )
2727}
2828
@@ -33,7 +33,8 @@ export function FacadeChangeEvent() {
3333 * @param {HTMLInputElement } el
3434 */
3535export function getInputElement ( el ) {
36- const inputElement = el instanceof HTMLInputElement ? el : el . querySelector ( 'input' )
36+ const inputElement =
37+ el instanceof HTMLInputElement ? el : el . querySelector ( 'input' )
3738
3839 /* istanbul ignore next */
3940 if ( ! inputElement ) {
@@ -49,7 +50,9 @@ export function getInputElement(el) {
4950 * @param {Number } position
5051 */
5152export function updateCursor ( el , position ) {
52- const setSelectionRange = ( ) => { el . setSelectionRange ( position , position ) }
53+ const setSelectionRange = ( ) => {
54+ el . setSelectionRange ( position , position )
55+ }
5356 setSelectionRange ( )
5457 // Android Fix
5558 setTimeout ( setSelectionRange ( ) , 1 )
@@ -63,7 +66,11 @@ export function updateCursor(el, position) {
6366 * @param {Boolean } options.emit Wether to dispatch a new InputEvent or not
6467 * @param {Boolean } options.force Forces the update even if the old value and the new value are the same
6568 */
66- export function updateValue ( el , vnode , { emit = true , force = false , clean = false } = { } ) {
69+ export function updateValue (
70+ el ,
71+ vnode ,
72+ { emit = true , force = false , clean = false } = { }
73+ ) {
6774 const { config } = el [ CONFIG_KEY ]
6875 let { oldValue } = el [ CONFIG_KEY ]
6976 let currentValue = vnode && vnode . props ? vnode . props . value : el . value
@@ -77,10 +84,10 @@ export function updateValue(el, vnode, { emit = true, force = false, clean = fal
7784
7885 // check value with in range max and min value
7986 if ( clean ) {
80- if ( config . max && unmasked > config . max ) {
87+ if ( Number ( config . max ) && unmasked > Number ( config . max ) ) {
8188 masked = number . format ( config . max )
8289 unmasked = number . unformat ( config . max )
83- } else if ( config . min && unmasked < config . min ) {
90+ } else if ( Number ( config . min ) && unmasked < Number ( config . min ) ) {
8491 masked = number . format ( config . min )
8592 unmasked = number . unformat ( config . min )
8693 }
@@ -96,7 +103,11 @@ export function updateValue(el, vnode, { emit = true, force = false, clean = fal
96103
97104 // this part needs to be outside the above IF statement for vuetify in firefox
98105 // drawback is that we endup with two's input events in firefox
99- return emit && el . dispatchEvent ( FacadeInputEvent ( ) ) && el . dispatchEvent ( FacadeChangeEvent ( ) )
106+ return (
107+ emit &&
108+ el . dispatchEvent ( FacadeInputEvent ( ) ) &&
109+ el . dispatchEvent ( FacadeChangeEvent ( ) )
110+ )
100111 }
101112}
102113
0 commit comments