@@ -140,6 +140,7 @@ export default class Selected extends React.Component {
140140 maxTagCount,
141141 isSearch,
142142 setSearchStatus,
143+ showTag,
143144 } ,
144145 state : { selected, clear } ,
145146 onMouseEnter,
@@ -149,8 +150,8 @@ export default class Selected extends React.Component {
149150 disabled,
150151 empty : supportUnlimited ? false : ! dataSource . length ,
151152 hidden : ! showSelectStyle ,
152- 'search-in-box' : searchable && searchInBox ,
153- 'multi-search-in-box' : searchable && searchInBox && multiple ,
153+ 'search-in-box' : searchable && searchInBox || multiple && showTag ,
154+ 'multi-search-in-box' : multiple && ( searchable && searchInBox || showTag ) ,
154155 [ `${ size } ` ] : true ,
155156 } ) ;
156157 const iconClasses = classnames ( `${ selector } -select-icon` , {
@@ -181,7 +182,7 @@ export default class Selected extends React.Component {
181182 if ( searchable && searchInBox && ! multiple ) {
182183 SearchCom = SingleSearch ;
183184 }
184- if ( searchable && searchInBox && multiple ) {
185+ if ( ( searchable && searchInBox || showTag ) && multiple ) {
185186 SearchCom = MultiSearch ;
186187 }
187188
@@ -193,12 +194,7 @@ export default class Selected extends React.Component {
193194 onMouseEnter = { onMouseEnter }
194195 onMouseLeave = { onMouseLeave }
195196 >
196- { ( ! searchable || searchable && ! searchInBox ) && (
197- < span className = { `${ selector } -selected` } title = { title } >
198- { selected . length ? selected : placeholder }
199- </ span >
200- ) }
201- { SearchCom && (
197+ { SearchCom ? (
202198 < SearchCom
203199 placeholder = { placeholder }
204200 selected = { this . state . selected }
@@ -214,7 +210,12 @@ export default class Selected extends React.Component {
214210 maxTagCount = { maxTagCount }
215211 setSearchStatus = { setSearchStatus }
216212 disabled = { disabled }
213+ searchable = { searchable && searchInBox }
217214 />
215+ ) : (
216+ < span className = { `${ selector } -selected` } title = { title } >
217+ { selected . length ? selected : placeholder }
218+ </ span >
218219 ) }
219220 < Icon type = "close-fill-1" className = { clearClasses } onClick = { onClear } />
220221 < Icon type = "search" className = { searchClasses } />
0 commit comments