@@ -8,7 +8,7 @@ import { TimesIcon } from '../icons/times';
88import { TimesCircleIcon } from '../icons/timescircle' ;
99import { OverlayService } from '../overlayservice/OverlayService' ;
1010import { Tooltip } from '../tooltip/Tooltip' ;
11- import { DomHandler , IconUtils , ObjectUtils , ZIndexUtils , classNames } from '../utils/Utils' ;
11+ import { DomHandler , IconUtils , ObjectUtils , UniqueComponentId , ZIndexUtils , classNames } from '../utils/Utils' ;
1212import { MultiSelectBase } from './MultiSelectBase' ;
1313import { MultiSelectPanel } from './MultiSelectPanel' ;
1414
@@ -1174,7 +1174,9 @@ export const MultiSelect = React.memo(
11741174 } ,
11751175 ptm ( 'hiddenInputWrapper' )
11761176 ) ;
1177-
1177+ const inputId = React . useMemo ( ( ) => {
1178+ return props . inputId ?? UniqueComponentId ( ) ;
1179+ } , [ props . inputId ] ) ;
11781180 const inputProps = mergeProps (
11791181 {
11801182 ref : inputRef ,
@@ -1186,6 +1188,7 @@ export const MultiSelect = React.memo(
11861188 onKeyDown : onKeyDown ,
11871189 role : 'combobox' ,
11881190 'aria-expanded' : overlayVisibleState ,
1191+ 'aria-controls' : `${ inputId } -multi-selectbox` ,
11891192 disabled : props . disabled ,
11901193 tabIndex : ! props . disabled ? props . tabIndex : - 1 ,
11911194 value : getLabel ( ) ,
@@ -1213,6 +1216,7 @@ export const MultiSelect = React.memo(
12131216 ref = { overlayRef }
12141217 visibleOptions = { visibleOptions }
12151218 { ...props }
1219+ listId = { `${ inputId } -multi-selectbox` }
12161220 onClick = { onPanelClick }
12171221 onOverlayHide = { hide }
12181222 filterValue = { filterValue }
0 commit comments