Skip to content

Commit

Permalink
pkg/lib: Give empty "Th" elements a aria-label attribute
Browse files Browse the repository at this point in the history
As requested by this warning:

    Th: Table headers must have an accessible name. If the Th is
    intended to be visually empty, pass in screenReaderText. If the Th
    contains only non-text, interactive content such as a checkbox or
    expand toggle, pass in an aria-label.
  • Loading branch information
mvollmer committed Apr 24, 2024
1 parent 7ad70e4 commit 0f59eef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/lib/cockpit-components-table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,9 @@ export const ListingTable = ({
<Table {...extraProps} {...tableProps}>
{showHeader && <Thead>
<Tr>
{isExpandable && <Th />}
{!onHeaderSelect && onSelect && <Th />}
{onHeaderSelect && onSelect && <Th select={{
{isExpandable && <Th aria-label={_("Expander")}/>}
{!onHeaderSelect && onSelect && <Th aria-label={_("Select")}/>}
{onHeaderSelect && onSelect && <Th aria-label={_("Select")} select={{
onSelect: onHeaderSelect,
isSelected: rows.every(r => r.selected)
}} />}
Expand Down

0 comments on commit 0f59eef

Please sign in to comment.