File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -248,15 +248,19 @@ export default {
248248 __setModel (val ) {
249249 clearTimeout (this .timer )
250250 this .focus ()
251- this .__set (val || (this .isNumber ? null : ' ' ))
251+ this .__set (val || (this .isNumber ? null : ' ' ), true )
252252 },
253- __set (e ) {
253+ __set (e , force ) {
254254 let val = e && e .target ? e .target .value : e
255255
256256 if (this .isNumber ) {
257+ const forcedValue = val
257258 val = parseFloat (val)
258259 if (isNaN (val)) {
259260 this .isNumberError = true
261+ if (force) {
262+ this .$emit (' input' , forcedValue)
263+ }
260264 return
261265 }
262266 this .isNumberError = false
Original file line number Diff line number Diff line change @@ -48,7 +48,11 @@ export default {
4848 __onBlur ( e ) {
4949 this . focused = false
5050 this . $emit ( 'blur' , e )
51- let value = this . isNumber && this . isNumberError ? null : this . model
51+ const isNumberError = this . isNumber && this . isNumberError
52+ const value = isNumberError ? null : this . model
53+ if ( isNumberError ) {
54+ this . $emit ( 'input' , value )
55+ }
5256 this . $nextTick ( ( ) => {
5357 if ( JSON . stringify ( value ) !== JSON . stringify ( this . value ) ) {
5458 this . $emit ( 'change' , value )
You can’t perform that action at this time.
0 commit comments