@@ -215,24 +215,24 @@ export class DxcNumberInputComponent implements OnInit, OnChanges, OnDestroy {
215
215
) } `;
216
216
}
217
217
218
- handleOnChange ( event ) {
218
+ handleOnChange ( { value , error } ) {
219
219
this . cdRef . detectChanges ( ) ;
220
- this . onChange . emit ( event ) ;
220
+ this . onChange . emit ( { value , error } ) ;
221
221
this . controlled
222
222
? ( this . dxcInputRef . inputRef . nativeElement . value = this . value )
223
- : ( this . value = event ) ;
223
+ : ( this . value = value ) ;
224
224
}
225
225
226
- handleOnBlur ( event ) {
227
- this . validationError = this . validateOnBlur ( ) ;
228
- this . onBlur . emit ( { value : event . value , error : this . validationError } ) ;
226
+ handleOnBlur ( { value , error } ) {
227
+ this . validationError = this . validation ( ) ;
228
+ this . onBlur . emit ( { value, error} ) ;
229
229
if ( ! this . controlled ) {
230
- this . value = event . value ;
230
+ this . value = value ;
231
231
this . cdRef . detectChanges ( ) ;
232
232
}
233
233
}
234
234
235
- validateOnBlur ( ) {
235
+ validation ( ) {
236
236
let err ;
237
237
const currentValue = coerceNumberProperty ( this . value ) ;
238
238
if ( this . value && this . min && currentValue < this . min ) {
@@ -244,7 +244,7 @@ export class DxcNumberInputComponent implements OnInit, OnChanges, OnDestroy {
244
244
}
245
245
246
246
handleStepMinus ( ) {
247
- this . handleOnBlur ( { value : this . value } ) ;
247
+ this . handleOnBlur ( { value : this . value , error : this . validation ( ) } ) ;
248
248
let currentValue ;
249
249
if ( this . value === null || this . value === undefined ) {
250
250
currentValue = 0 ;
@@ -257,7 +257,7 @@ export class DxcNumberInputComponent implements OnInit, OnChanges, OnDestroy {
257
257
}
258
258
259
259
handleStepPlus ( ) {
260
- this . handleOnBlur ( { value : this . value } ) ;
260
+ this . handleOnBlur ( { value : this . value , error : this . validation ( ) } ) ;
261
261
let currentValue ;
262
262
if ( this . value === null || this . value === undefined ) {
263
263
currentValue = 0 ;
0 commit comments