@@ -16,7 +16,11 @@ export function MultiSelection({
1616 a11yConfig,
1717 menuFooterContent,
1818 ariaRequired,
19- ...options
19+ labelId,
20+ inputId,
21+ ariaLabel,
22+ readOnlyStyle,
23+ noOptionsText
2024} : SelectionBaseProps < MultiSelector > ) : ReactElement {
2125 const {
2226 isOpen,
@@ -33,11 +37,11 @@ export function MultiSelection({
3337 items,
3438 setSelectedItems,
3539 toggleSelectedItem
36- } = useDownshiftMultiSelectProps ( selector , { ... options } , a11yConfig . a11yStatusMessage ) ;
40+ } = useDownshiftMultiSelectProps ( selector , { inputId , labelId } , a11yConfig . a11yStatusMessage ) ;
3741 const inputRef = useRef < HTMLInputElement > ( null ) ;
3842 const isSelectedItemsBoxStyle = selector . selectedItemsStyle === "boxes" ;
3943 const isOptionsSelected = selector . isOptionsSelected ( ) ;
40- const inputLabel = getInputLabel ( options . inputId ) ;
44+ const inputLabel = getInputLabel ( inputId ) ;
4145 const hasLabel = useMemo ( ( ) => Boolean ( inputLabel ) , [ inputLabel ] ) ;
4246 const inputProps = getInputProps ( {
4347 ...getDropdownProps (
@@ -65,7 +69,7 @@ export function MultiSelection({
6569 disabled : selector . readOnly ,
6670 readOnly : selector . options . filterType === "none" ,
6771 "aria-required" : ariaRequired . value ,
68- "aria-label" : ! hasLabel && options . ariaLabel ? options . ariaLabel : undefined
72+ "aria-label" : ! hasLabel && ariaLabel ? ariaLabel : undefined
6973 } ) ;
7074
7175 const memoizedselectedCaptions = useMemo (
@@ -91,7 +95,7 @@ export function MultiSelection({
9195 < ComboboxWrapper
9296 isOpen = { isOpen }
9397 readOnly = { selector . readOnly }
94- readOnlyStyle = { options . readOnlyStyle }
98+ readOnlyStyle = { readOnlyStyle }
9599 getToggleButtonProps = { getToggleButtonProps }
96100 validation = { selector . validation }
97101 isLoading = { lazyLoading && selector . options . isLoading }
@@ -168,7 +172,7 @@ export function MultiSelection({
168172 < SelectAllButton
169173 disabled = { items . length === 0 }
170174 value = { isOptionsSelected }
171- id = { `${ options . inputId } -select-all-button` }
175+ id = { `${ inputId } -select-all-button` }
172176 ariaLabel = { a11yConfig . ariaLabels . selectAll }
173177 onChange = { ( ) => {
174178 if ( isOptionsSelected === "all" ) {
@@ -181,15 +185,15 @@ export function MultiSelection({
181185 ) : undefined
182186 }
183187 menuFooterContent = { menuFooterContent }
184- inputId = { options . inputId }
188+ inputId = { inputId }
185189 selector = { selector }
186190 isOpen = { isOpen }
187191 highlightedIndex = { highlightedIndex }
188192 selectableItems = { items }
189193 getItemProps = { getItemProps }
190194 getMenuProps = { getMenuProps }
191195 selectedItems = { selectedItems }
192- noOptionsText = { options . noOptionsText }
196+ noOptionsText = { noOptionsText }
193197 onOptionClick = { ( ) => {
194198 inputRef . current ?. focus ( ) ;
195199 } }
0 commit comments