Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "DetailsList: adjusting aria labels and exporting more ariaLabels in `IColumn` to allow for better narrator reading and table scanning.",
"type": "minor"
}
],
"packageName": "office-ui-fabric-react",
"email": "tmichon@microsoft.com"
}
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class DetailsHeader extends BaseComponent<IDetailsHeaderProps, IDetailsHe
) }
aria-labelledby={ `${this._id}-check` }
onClick={ this._onSelectAllClicked }
aria-colindex={ 0 }
aria-colindex={ 1 }
role='columnheader'
>
{
Expand Down Expand Up @@ -225,7 +225,7 @@ export class DetailsHeader extends BaseComponent<IDetailsHeaderProps, IDetailsHe
role='columnheader'
aria-sort={ column.isSorted ? (column.isSortedDescending ? 'descending' : 'ascending') : 'none' }
aria-disabled={ column.columnActionsMode === ColumnActionsMode.disabled }
aria-colindex={ (showCheckbox ? 1 : 0) + columnIndex }
aria-colindex={ (showCheckbox ? 2 : 1) + columnIndex }
className={ css(
'ms-DetailsHeader-cell',
styles.cell,
Expand Down Expand Up @@ -273,19 +273,28 @@ export class DetailsHeader extends BaseComponent<IDetailsHeaderProps, IDetailsHe
</span>

{ column.isFiltered && (
<Icon className={ styles.nearIcon } iconName='Filter' />
<Icon ariaLabel={ column.filterAriaLabel } className={ styles.nearIcon } iconName='Filter' />
) }

{ column.isSorted && (
<Icon className={ css(styles.nearIcon, styles.sortIcon) } iconName={ column.isSortedDescending ? 'SortDown' : 'SortUp' } />
<Icon
ariaLabel={
column.isSortedDescending ?
column.sortDescendingAriaLabel :
column.sortAscendingAriaLabel
}
className={ css(styles.nearIcon, styles.sortIcon) }
iconName={ column.isSortedDescending ? 'SortDown' : 'SortUp' }
/>
) }

{ column.isGrouped && (
<Icon className={ styles.nearIcon } iconName='GroupedDescending' />
<Icon ariaLabel={ column.groupAriaLabel } className={ styles.nearIcon } iconName='GroupedDescending' />
) }

{ column.columnActionsMode === ColumnActionsMode.hasDropdown && !column.isIconOnly && (
<Icon
aria-hidden={ true }
className={ css('ms-DetailsHeader-filterChevron', styles.filterChevron) }
iconName='ChevronDown'
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,23 @@ export interface IColumn {
* If set, will add additional LTR padding-right to column and cells.
*/
isPadded?: boolean;

/**
* ARIA label for the sort order of this column when sorted ascending.
*/
sortAscendingAriaLabel?: string;
/**
* ARIA label for the sort order of this column when sorted descending.
*/
sortDescendingAriaLabel?: string;
/**
* ARIA label for the status of this column when grouped.
*/
groupAriaLabel?: string;
/**
* ARIA label for the status of this column when filtered.
*/
filterAriaLabel?: string;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export class DetailsRow extends BaseComponent<IDetailsRowProps, IDetailsRowState
{ showCheckbox && (
<div
role='gridcell'
aria-colindex={ 0 }
aria-colindex={ 1 }
data-selection-toggle={ true }
className={ css('ms-DetailsRow-cell', 'ms-DetailsRow-cellCheck', checkStyles.owner, styles.cell, styles.checkCell, checkboxCellClassName) }
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class DetailsRowFields extends BaseComponent<IDetailsRowFieldsProps, IDet
<div
key={ columnIndex }
role={ column.isRowHeader ? 'rowheader' : 'gridcell' }
aria-colindex={ columnIndex + columnStartIndex }
aria-colindex={ columnIndex + columnStartIndex + 1 }
className={ css('ms-DetailsRow-cell', styles.cell, column.className,
column.isMultiline && 'is-multiline',
column.isRowHeader && styles.isRowHeader,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports[`DetailsHeader can render 1`] = `
role="row"
>
<div
aria-colindex={0}
aria-colindex={1}
aria-labelledby="header0-check"
className="ms-DetailsHeader-cell ms-DetailsHeader-cellIsCheck"
onClick={[Function]}
Expand Down Expand Up @@ -130,7 +130,7 @@ exports[`DetailsHeader can render 1`] = `
</span>
</div>
<div
aria-colindex={1}
aria-colindex={2}
aria-disabled={false}
aria-sort="none"
className="ms-DetailsHeader-cell is-actionable undefined"
Expand Down Expand Up @@ -178,7 +178,7 @@ exports[`DetailsHeader can render 1`] = `
role="button"
/>
<div
aria-colindex={2}
aria-colindex={3}
aria-disabled={false}
aria-sort="none"
className="ms-DetailsHeader-cell is-actionable undefined"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ exports[`DetailsList renders List correctly 1`] = `
role="row"
>
<div
aria-colindex={0}
aria-colindex={1}
aria-labelledby="header0-check"
className="ms-DetailsHeader-cell ms-DetailsHeader-cellIsCheck"
onClick={[Function]}
Expand Down Expand Up @@ -156,7 +156,7 @@ exports[`DetailsList renders List correctly 1`] = `
</span>
</div>
<div
aria-colindex={1}
aria-colindex={2}
aria-disabled={false}
aria-sort="none"
className="ms-DetailsHeader-cell is-actionable undefined"
Expand Down