@@ -45,14 +45,14 @@ export class Numeric extends _NumericBase {
4545 $ ( this . $el ) . find ( 'input' ) . autoNumeric ( 'destroy' ) ;
4646 this . setupUI ( ) ;
4747 }
48-
49-
48+
49+
5050 setupUI ( ) {
5151 var def = this . $UI . $settings . numeric
5252
5353 var opt = {
5454 aDec : Util . pickNonEmpty ( this . decimalSeparator , def . decimalSeparator ) ,
55- aSep : Util . pickNonEmpty ( this . groupSeparator , def . groupSeparator ) ,
55+ aSep : Util . pickNonEmpty ( this . groupSeparator , def . groupSeparator ) ,
5656 mDec : Util . pickNonEmpty ( this . decimalPlaces , def . decimalPlaces ) ,
5757 vMin : Util . pickNonEmpty ( this . min , def . min ) ,
5858 vMax : Util . pickNonEmpty ( this . max , def . max )
@@ -64,12 +64,15 @@ export class Numeric extends _NumericBase {
6464 }
6565
6666 var target = $ ( this . $el ) . find ( 'input' )
67- . autoNumeric ( 'init' , this . buildOptions ( opt ) )
68- . autoNumeric ( 'set' , this . value || 0 ) . on ( 'keyup change paste propertychange' , ( v ) => {
69- var value = $ ( v . target ) . autoNumeric ( 'get' )
70- this . $emit ( 'input' , value )
71- this . $emit ( 'change' , value )
72- } )
67+ . autoNumeric ( 'init' , this . buildOptions ( opt ) )
68+ . autoNumeric ( 'set' , this . value || 0 ) . on ( 'keyup change paste propertychange' , ( v ) => {
69+ var value = $ ( v . target ) . autoNumeric ( 'get' )
70+ this . $emit ( 'input' , value )
71+ this . $emit ( 'change' , value )
72+ } )
73+
74+ if ( this . selectOnFocus )
75+ target . on ( 'focus' , function ( ) { $ ( this ) . select ( ) } )
7376
7477 Util . setDataValidateAttr ( this , target )
7578 }
0 commit comments