File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -55,15 +55,19 @@ export default class Field extends Component {
5555 }
5656
5757 filterOption = ( input , option ) => {
58- const isInChildren = option . props . children . toLowerCase ( ) . indexOf ( input . toLowerCase ( ) ) >= 0
59- const isInValue = option . props . value . toLowerCase ( ) . indexOf ( input . toLowerCase ( ) ) >= 0
60- let isInGroupLabel = false
58+ const { value, groupLabel } = option . props ;
6159
62- if ( option . props . groupLabel ) {
63- isInGroupLabel = option . props . groupLabel . toLowerCase ( ) . indexOf ( input . toLowerCase ( ) ) >= 0
60+ let isInValue = false ;
61+ if ( typeof value === 'string' ) {
62+ isInValue = value . toLowerCase ( ) . indexOf ( input . toLowerCase ( ) ) >= 0 ;
6463 }
6564
66- return ( isInChildren || isInValue || isInGroupLabel )
65+ let isInGroupLabel = false ;
66+ if ( typeof groupLabel === 'string' ) {
67+ isInGroupLabel = groupLabel . toLowerCase ( ) . indexOf ( input . toLowerCase ( ) ) >= 0 ;
68+ }
69+
70+ return isInValue || isInGroupLabel ;
6771 }
6872
6973 getFieldDisplayLabel ( field , fieldKey ) {
You can’t perform that action at this time.
0 commit comments