@@ -46,6 +46,8 @@ export interface ListManagerProps {
4646 onCancel ?: ( ) => void ;
4747 /** Enable drag and drop functionality for reordering items */
4848 enableDragDrop ?: boolean ;
49+ /** Custom aria-label for the DataList */
50+ dataListAriaLabel ?: string ;
4951}
5052
5153const ListManager : FunctionComponent < ListManagerProps > = (
@@ -56,7 +58,8 @@ const ListManager: FunctionComponent<ListManagerProps> = (
5658 onOrderChange,
5759 onSave,
5860 onCancel,
59- enableDragDrop = true } : ListManagerProps ) => {
61+ enableDragDrop = true ,
62+ dataListAriaLabel = 'Selected columns' } : ListManagerProps ) => {
6063
6164 const [ currentColumns , setCurrentColumns ] = useState (
6265 ( ) => columns . map ( column => ( { ...column , isSelected : column . isSelected ?? column . isShownByDefault , id : column . key } ) )
@@ -115,14 +118,13 @@ const ListManager: FunctionComponent<ListManagerProps> = (
115118 isChecked = { column . isSelected }
116119 onChange = { ( ) => handleChange ( column . key ) }
117120 isDisabled = { column . isUntoggleable }
118- aria-labelledby = { `${ ouiaId } -column-${ index } -label` }
119121 ouiaId = { `${ ouiaId } -column-${ index } -checkbox` }
120122 id = { `${ ouiaId } -column-${ index } -checkbox` }
121123 />
122124 < DataListItemCells
123125 dataListCells = { [
124126 < DataListCell key = { column . key } data-ouia-component-id = { `${ ouiaId } -column-${ index } -label` } >
125- < label htmlFor = { `${ ouiaId } -column-${ index } -checkbox` } id = { ` ${ ouiaId } -column- ${ index } -label` } >
127+ < label htmlFor = { `${ ouiaId } -column-${ index } -checkbox` } >
126128 { column . title }
127129 </ label >
128130 </ DataListCell >
@@ -158,11 +160,11 @@ const ListManager: FunctionComponent<ListManagerProps> = (
158160 // eslint-disable-next-line no-console
159161 ( { id : column . key , content : column . title } )
160162 ) }
161- wrapper = { < DataList aria-label = "Selected columns" isCompact data-ouia-component-id = { `${ ouiaId } -column-list` } /> }
163+ wrapper = { < DataList aria-label = { dataListAriaLabel } isCompact data-ouia-component-id = { `${ ouiaId } -column-list` } /> }
162164 />
163165 </ DragDropSort >
164166 ) : (
165- < DataList aria-label = "Selected columns" isCompact data-ouia-component-id = { `${ ouiaId } -column-list` } >
167+ < DataList aria-label = { dataListAriaLabel } isCompact data-ouia-component-id = { `${ ouiaId } -column-list` } >
166168 { currentColumns . map ( ( column , index ) => (
167169 < DataListItem key = { column . key } >
168170 { renderDataListItem ( column , index ) }
0 commit comments