Skip to content

Commit 6bb9f35

Browse files
authored
Refactor(DataList): removed aria-labelledby and aria-selected (#11569)
* Refactor(DataList): removed aria-labelledby and aria-selected * updated snapshot for DataListItem * updated prop description
1 parent 684f7a4 commit 6bb9f35

File tree

3 files changed

+1
-5
lines changed

3 files changed

+1
-5
lines changed

packages/react-core/src/components/DataList/DataListItem.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export interface DataListItemProps extends Omit<React.HTMLProps<HTMLLIElement>,
1111
children: React.ReactNode;
1212
/** Additional classes added to the DataList item should be either <DataListItemRow> or <DataListContent> */
1313
className?: string;
14-
/** Adds accessible text to the DataList item */
14+
/** Adds an accessible name to the selectable input if one is rendered */
1515
'aria-labelledby': string;
1616
/** Unique id for the DataList item */
1717
id?: string;
@@ -86,9 +86,7 @@ class DataListItem extends React.Component<DataListItemProps> {
8686
selectedDataListItemId && isSelected && styles.modifiers.selected,
8787
className
8888
)}
89-
aria-labelledby={ariaLabelledBy}
9089
{...(isSelectable && { tabIndex: 0, onClick: selectDataListItem, onKeyDown })}
91-
{...(isSelectable && isSelected && { 'aria-selected': true })}
9290
{...props}
9391
>
9492
{onSelectableRowChange && (

packages/react-core/src/components/DataList/__tests__/Generated/__snapshots__/DataListItem.test.tsx.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
exports[`DataListItem should match snapshot (auto-generated) 1`] = `
44
<DocumentFragment>
55
<li
6-
aria-labelledby="string"
76
class="pf-v6-c-data-list__item ''"
87
id="''"
98
>

packages/react-core/src/components/DataList/__tests__/__snapshots__/DataListItem.test.tsx.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
exports[`Renders to match snapshot 1`] = `
44
<DocumentFragment>
55
<li
6-
aria-labelledby="item-1"
76
class="pf-v6-c-data-list__item"
87
id=""
98
/>

0 commit comments

Comments
 (0)