@@ -12,7 +12,7 @@ import omit from '../utils/omit';
12
12
import actionTypes from '../action-types' ;
13
13
import debounce from '../utils/debounce' ;
14
14
15
- import getValue from '../utils/get-value' ;
15
+ import _getValue from '../utils/get-value' ;
16
16
import getValidity from '../utils/get-validity' ;
17
17
import invertValidity from '../utils/invert-validity' ;
18
18
import getFieldFromState from '../utils/get-field-from-state' ;
@@ -114,6 +114,7 @@ const propTypes = {
114
114
withField : PropTypes . bool ,
115
115
debounce : PropTypes . number ,
116
116
persist : PropTypes . bool ,
117
+ getValue : PropTypes . func ,
117
118
} ;
118
119
119
120
const defaultStrategy = {
@@ -226,6 +227,7 @@ function createControlClass(s = defaultStrategy) {
226
227
model,
227
228
modelValue,
228
229
changeAction,
230
+ getValue,
229
231
} = this . props ;
230
232
const value = this . isToggle ( )
231
233
? getToggleValue ( this . props )
@@ -284,6 +286,7 @@ function createControlClass(s = defaultStrategy) {
284
286
modelValue,
285
287
updateOn,
286
288
dispatch,
289
+ getValue,
287
290
} = this . props ;
288
291
289
292
// If there are no async validators,
@@ -423,6 +426,8 @@ function createControlClass(s = defaultStrategy) {
423
426
}
424
427
425
428
handleChange ( event ) {
429
+ const { getValue } = this . props ;
430
+
426
431
if ( event && event . persist ) event . persist ( ) ;
427
432
428
433
this . setViewValue ( getValue ( event ) ) ;
@@ -433,6 +438,7 @@ function createControlClass(s = defaultStrategy) {
433
438
const {
434
439
controlProps : { onKeyPress } ,
435
440
dispatch,
441
+ getValue,
436
442
} = this . props ;
437
443
438
444
// Get the value from the event
@@ -498,6 +504,7 @@ function createControlClass(s = defaultStrategy) {
498
504
ignore,
499
505
withField,
500
506
fieldValue,
507
+ getValue,
501
508
} = this . props ;
502
509
503
510
const eventAction = {
@@ -640,6 +647,7 @@ function createControlClass(s = defaultStrategy) {
640
647
component : 'input' ,
641
648
withField : true ,
642
649
persist : false ,
650
+ getValue : _getValue ,
643
651
} ;
644
652
645
653
function mapStateToProps ( state , props ) {
0 commit comments