File tree Expand file tree Collapse file tree 1 file changed +6
-16
lines changed Expand file tree Collapse file tree 1 file changed +6
-16
lines changed Original file line number Diff line number Diff line change @@ -227,19 +227,9 @@ class Picker extends PureComponent {
227
227
} ;
228
228
} ;
229
229
230
- shouldNotChangePickerLabelWhileSelecting = ( ) => {
231
- const { mode} = this . props ;
232
- return mode === Picker . modes . MULTI ;
233
- } ;
234
-
235
230
getLabelValueText = ( ) => {
236
- const { value : propsValue } = this . props ;
237
- const { value : stateValue } = this . props ;
238
-
239
- if ( this . shouldNotChangePickerLabelWhileSelecting ( ) ) {
240
- return this . getLabel ( propsValue ) ;
241
- }
242
- return this . getLabel ( stateValue ) ;
231
+ const { value} = this . props ;
232
+ return this . getLabel ( value ) ;
243
233
} ;
244
234
245
235
getLabelsFromArray = value => {
@@ -256,14 +246,14 @@ class Picker extends PureComponent {
256
246
getLabel ( value ) {
257
247
const { getLabel} = this . props ;
258
248
249
+ if ( _ . isFunction ( getLabel ) && ! _ . isUndefined ( getLabel ( value ) ) ) {
250
+ return getLabel ( value ) ;
251
+ }
252
+
259
253
if ( _ . isArray ( value ) ) {
260
254
return this . getLabelsFromArray ( value ) ;
261
255
}
262
256
263
- if ( _ . isFunction ( getLabel ) ) {
264
- return getLabel ( value ) ;
265
- }
266
-
267
257
if ( _ . isPlainObject ( value ) ) {
268
258
return _ . get ( value , 'label' ) ;
269
259
}
You can’t perform that action at this time.
0 commit comments