@@ -16,11 +16,7 @@ export function MultiSelection({
1616 a11yConfig,
1717 menuFooterContent,
1818 ariaRequired,
19- labelId,
20- inputId,
21- ariaLabel,
22- readOnlyStyle,
23- noOptionsText
19+ ...options
2420} : SelectionBaseProps < MultiSelector > ) : ReactElement {
2521 const {
2622 isOpen,
@@ -37,11 +33,11 @@ export function MultiSelection({
3733 items,
3834 setSelectedItems,
3935 toggleSelectedItem
40- } = useDownshiftMultiSelectProps ( selector , { inputId , labelId } , a11yConfig . a11yStatusMessage ) ;
36+ } = useDownshiftMultiSelectProps ( selector , options , a11yConfig . a11yStatusMessage ) ;
4137 const inputRef = useRef < HTMLInputElement > ( null ) ;
4238 const isSelectedItemsBoxStyle = selector . selectedItemsStyle === "boxes" ;
4339 const isOptionsSelected = selector . isOptionsSelected ( ) ;
44- const inputLabel = getInputLabel ( inputId ) ;
40+ const inputLabel = getInputLabel ( options . inputId ) ;
4541 const hasLabel = useMemo ( ( ) => Boolean ( inputLabel ) , [ inputLabel ] ) ;
4642 const inputProps = getInputProps ( {
4743 ...getDropdownProps (
@@ -69,7 +65,7 @@ export function MultiSelection({
6965 disabled : selector . readOnly ,
7066 readOnly : selector . options . filterType === "none" ,
7167 "aria-required" : ariaRequired . value ,
72- "aria-label" : ! hasLabel && ariaLabel ? ariaLabel : undefined
68+ "aria-label" : ! hasLabel && options . ariaLabel ? options . ariaLabel : undefined
7369 } ) ;
7470
7571 const memoizedselectedCaptions = useMemo (
@@ -95,7 +91,7 @@ export function MultiSelection({
9591 < ComboboxWrapper
9692 isOpen = { isOpen }
9793 readOnly = { selector . readOnly }
98- readOnlyStyle = { readOnlyStyle }
94+ readOnlyStyle = { options . readOnlyStyle }
9995 getToggleButtonProps = { getToggleButtonProps }
10096 validation = { selector . validation }
10197 isLoading = { lazyLoading && selector . options . isLoading }
@@ -172,7 +168,7 @@ export function MultiSelection({
172168 < SelectAllButton
173169 disabled = { items . length === 0 }
174170 value = { isOptionsSelected }
175- id = { `${ inputId } -select-all-button` }
171+ id = { `${ options . inputId } -select-all-button` }
176172 ariaLabel = { a11yConfig . ariaLabels . selectAll }
177173 onChange = { ( ) => {
178174 if ( isOptionsSelected === "all" ) {
@@ -185,15 +181,15 @@ export function MultiSelection({
185181 ) : undefined
186182 }
187183 menuFooterContent = { menuFooterContent }
188- inputId = { inputId }
184+ inputId = { options . inputId }
189185 selector = { selector }
190186 isOpen = { isOpen }
191187 highlightedIndex = { highlightedIndex }
192188 selectableItems = { items }
193189 getItemProps = { getItemProps }
194190 getMenuProps = { getMenuProps }
195191 selectedItems = { selectedItems }
196- noOptionsText = { noOptionsText }
192+ noOptionsText = { options . noOptionsText }
197193 onOptionClick = { ( ) => {
198194 inputRef . current ?. focus ( ) ;
199195 } }
0 commit comments