Skip to content

Commit

Permalink
Added aria-activedescendant prop
Browse files Browse the repository at this point in the history
  • Loading branch information
adirhaz1z committed Apr 8, 2021
1 parent 595fc9f commit 6a0f677
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
3 changes: 1 addition & 2 deletions source/Collection/Collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {ScrollPosition, SizeInfo} from './types';
*/
export default class Collection extends React.PureComponent {
static propTypes = {
'aria-label': PropTypes.string,
'aria-label'?: PropTypes.string,

/**
* Number of cells in Collection.
Expand Down Expand Up @@ -48,7 +48,6 @@ export default class Collection extends React.PureComponent {
};

static defaultProps = {
'aria-label': 'grid',
cellGroupRenderer: defaultCellGroupRenderer,
};

Expand Down
3 changes: 1 addition & 2 deletions source/Collection/CollectionView.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const SCROLL_POSITION_CHANGE_REASONS = {
*/
class CollectionView extends React.PureComponent {
static propTypes = {
'aria-label': PropTypes.string,
'aria-label'?: PropTypes.string,

/**
* Removes fixed height from the scrollingContainer so that the total height
Expand Down Expand Up @@ -129,7 +129,6 @@ class CollectionView extends React.PureComponent {
};

static defaultProps = {
'aria-label': 'grid',
horizontalOverscanSize: 0,
noContentRenderer: () => null,
onScroll: () => null,
Expand Down
4 changes: 3 additions & 1 deletion source/Grid/Grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ type ScrollPosition = {
};

type Props = {
'aria-label': string,
'aria-label'?: string,
'aria-readonly'?: boolean,
'aria-activedescendant'?: string,

/**
* Set the width of the inner scrollable container to 'auto'.
Expand Down Expand Up @@ -1044,6 +1045,7 @@ class Grid extends React.PureComponent<Props, State> {
{...containerProps}
aria-label={this.props['aria-label']}
aria-readonly={this.props['aria-readonly']}
aria-activedescendant={this.props['aria-activedescendant']}
className={clsx('ReactVirtualized__Grid', className)}
id={id}
onScroll={this._onScroll}
Expand Down
1 change: 1 addition & 0 deletions source/List/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import clsx from 'clsx';

type Props = {
'aria-label'?: string,
'aria-activedescendant'?: string,

/**
* Removes fixed height from the scrollingContainer so that the total height
Expand Down
4 changes: 3 additions & 1 deletion source/Table/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import SortDirection from './SortDirection';
export default class Table extends React.PureComponent {
static propTypes = {
/** This is just set on the grid top element. */
'aria-label': PropTypes.string,
'aria-label'?: PropTypes.string,
'aria-activedescendant'?: PropTypes.string,

/** This is just set on the grid top element. */
'aria-labelledby': PropTypes.string,
Expand Down Expand Up @@ -430,6 +431,7 @@ export default class Table extends React.PureComponent {

<Grid
{...this.props}
aria-activedescendant={this.props['aria-activedescendant']}
aria-readonly={null}
autoContainerWidth
className={clsx('ReactVirtualized__Table__Grid', gridClassName)}
Expand Down

0 comments on commit 6a0f677

Please sign in to comment.