@@ -133,6 +133,7 @@ function createControlClass(s = defaultStrategy) {
133
133
this . handleFocus = this . createEventHandler ( 'focus' ) . bind ( this ) ;
134
134
this . handleBlur = this . createEventHandler ( 'blur' ) . bind ( this ) ;
135
135
this . handleUpdate = this . createEventHandler ( 'change' ) . bind ( this ) ;
136
+ this . forceHandleUpdate = this . createEventHandler ( 'change' , true ) . bind ( this ) ;
136
137
this . handleChange = this . handleChange . bind ( this ) ;
137
138
this . handleLoad = this . handleLoad . bind ( this ) ;
138
139
this . getMappedProps = this . getMappedProps . bind ( this ) ;
@@ -422,11 +423,11 @@ function createControlClass(s = defaultStrategy) {
422
423
: value ;
423
424
}
424
425
425
- handleChange ( event , forceUpdate = false ) {
426
+ handleChange ( event ) {
426
427
if ( event && event . persist ) event . persist ( ) ;
427
428
428
429
this . setViewValue ( this . getValue ( event ) ) ;
429
- this . handleUpdate ( event , forceUpdate ) ;
430
+ this . handleUpdate ( event ) ;
430
431
}
431
432
432
433
handleKeyPress ( event ) {
@@ -437,7 +438,7 @@ function createControlClass(s = defaultStrategy) {
437
438
if ( onKeyPress ) onKeyPress ( event ) ;
438
439
439
440
if ( event . key === 'Enter' ) {
440
- this . handleChange ( event , true ) ;
441
+ this . forceHandleUpdate ( event ) ;
441
442
}
442
443
}
443
444
@@ -481,13 +482,13 @@ function createControlClass(s = defaultStrategy) {
481
482
if ( onLoad ) onLoad ( modelValue , fieldValue , this . node ) ;
482
483
}
483
484
484
- createEventHandler ( eventName ) {
485
+ createEventHandler ( eventName , forceUpdate = false ) {
485
486
const eventAction = {
486
487
focus : actions . silentFocus ,
487
488
blur : actions . blur ,
488
489
} [ eventName ] ;
489
490
490
- const dispatchBatchActions = ( persistedEvent , forceUpdate = false ) => {
491
+ const dispatchBatchActions = ( persistedEvent ) => {
491
492
const {
492
493
dispatch,
493
494
model,
@@ -511,7 +512,7 @@ function createControlClass(s = defaultStrategy) {
511
512
return persistedEvent ;
512
513
} ;
513
514
514
- return ( event , forceUpdate = false ) => {
515
+ return ( event ) => {
515
516
const {
516
517
controlProps,
517
518
parser,
@@ -540,7 +541,7 @@ function createControlClass(s = defaultStrategy) {
540
541
}
541
542
542
543
return compose (
543
- ( e ) => dispatchBatchActions ( e , forceUpdate ) ,
544
+ dispatchBatchActions ,
544
545
parser ,
545
546
( e ) => this . getValue ( e ) ,
546
547
persistEventWithCallback ( controlEventHandler || identity )
0 commit comments