@@ -63,6 +63,7 @@ export type SelectInputContainerProps<
6363 onClearButtonClick : ( ) => void ;
6464 onSelectAllButtonClick ?: ( ) => void ;
6565 onEnterWithoutOption ?: ( ) => void ;
66+ dropdownHidden ?: boolean ;
6667 } , OMISSION >
6768 & Omit < InputContainerProps , 'input' >
6869 ) ;
@@ -126,6 +127,7 @@ function SelectInputContainer<
126127 required,
127128 variant,
128129 errorOnTooltip,
130+ dropdownHidden,
129131 } = props ;
130132
131133 const options = optionsFromProps ?? ( emptyList as OPTION [ ] ) ;
@@ -183,11 +185,9 @@ function SelectInputContainer<
183185 if ( readOnly ) {
184186 return ;
185187 }
186- if ( options . length > 0 ) {
187- handleShowDropdown ( ) ;
188- }
188+ handleShowDropdown ( ) ;
189189 } ,
190- [ readOnly , handleShowDropdown , options ] ,
190+ [ readOnly , handleShowDropdown ] ,
191191 ) ;
192192
193193 const handlePopupBlur = useCallback (
@@ -259,6 +259,8 @@ function SelectInputContainer<
259259 ? `${ strings . infoMessageAnd } ${ totalOptionsCount - optionsCount } ${ strings . infoMessageMore } `
260260 : undefined ;
261261
262+ const dropdownShownActual = dropdownShown && ! dropdownHidden ;
263+
262264 return (
263265 < >
264266 < InputContainer
@@ -311,11 +313,11 @@ function SelectInputContainer<
311313 onClick = { handleToggleDropdown }
312314 variant = "tertiary"
313315 name = { undefined }
314- title = { dropdownShown
316+ title = { dropdownShownActual
315317 ? strings . buttonTitleClose
316318 : strings . buttonTitleOpen }
317319 >
318- { dropdownShown
320+ { dropdownShownActual
319321 ? < ArrowUpSmallFillIcon className = { styles . icon } />
320322 : < ArrowDownSmallFillIcon className = { styles . icon } /> }
321323 </ Button >
@@ -340,7 +342,7 @@ function SelectInputContainer<
340342 />
341343 ) }
342344 />
343- { dropdownShown && (
345+ { dropdownShownActual && (
344346 < Popup
345347 elementRef = { popupRef }
346348 parentRef = { inputSectionRef }
0 commit comments