@@ -55,15 +55,24 @@ 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, children } = option . props ;
6159
62- if ( option . props . groupLabel ) {
63- isInGroupLabel = option . props . groupLabel . toLowerCase ( ) . indexOf ( input . toLowerCase ( ) ) >= 0
60+ let isInChildren = false ;
61+ if ( typeof children === 'string' ) {
62+ isInChildren = children . toLowerCase ( ) . indexOf ( input . toLowerCase ( ) ) >= 0 ;
6463 }
6564
66- return ( isInChildren || isInValue || isInGroupLabel )
65+ let isInValue = false ;
66+ if ( typeof value === 'string' ) {
67+ isInValue = value . toLowerCase ( ) . indexOf ( input . toLowerCase ( ) ) >= 0 ;
68+ }
69+
70+ let isInGroupLabel = false ;
71+ if ( typeof groupLabel === 'string' ) {
72+ isInGroupLabel = groupLabel . toLowerCase ( ) . indexOf ( input . toLowerCase ( ) ) >= 0 ;
73+ }
74+
75+ return isInChildren || isInValue || isInGroupLabel ;
6776 }
6877
6978 getFieldDisplayLabel ( field , fieldKey ) {
@@ -118,7 +127,7 @@ export default class Field extends Component {
118127 return < Option
119128 key = { prefix + fieldKey }
120129 value = { prefix + fieldKey }
121- groupLabel = { optGroupLabel }
130+ grouplabel = { optGroupLabel }
122131 >
123132 { label }
124133 </ Option > ;
@@ -167,7 +176,7 @@ export default class Field extends Component {
167176 let fieldDisplayLabel = isFieldSelected ? this . getFieldDisplayLabel ( this . curField ( ) , this . props . selectedField ) : null ;
168177 let selectText = isFieldSelected ? fieldDisplayLabel : placeholder ;
169178 selectText = truncateString ( selectText , maxLabelsLength ) ;
170- let selectWidth = calcTextWidth ( selectText , '12px ' ) ;
179+ let selectWidth = calcTextWidth ( selectText , '14px ' ) ;
171180 //let tooltip = this.curFieldOpts().label2 || selectedFieldFullLabel || this.curFieldOpts().label;
172181 let fieldSelectItems = this . buildSelectItems ( fieldOptions ) ;
173182 let customProps = this . props . customProps || { } ;
@@ -176,7 +185,7 @@ export default class Field extends Component {
176185 < Select
177186 dropdownAlign = { dropdownPlacement ? BUILT_IN_PLACEMENTS [ dropdownPlacement ] : undefined }
178187 dropdownMatchSelectWidth = { false }
179- style = { { width : isFieldSelected && ! customProps . showSearch ? null : selectWidth + 36 } }
188+ style = { { width : isFieldSelected && ! customProps . showSearch ? null : selectWidth + 48 } }
180189 ref = "field"
181190 placeholder = { placeholder }
182191 size = { this . props . config . settings . renderSize || "small" }
0 commit comments