Skip to content

Commit

Permalink
allow null aria-label for role presentation, add key to virtual grid
Browse files Browse the repository at this point in the history
  • Loading branch information
priley86 committed May 24, 2019
1 parent d66d119 commit 13f5211
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,21 +125,21 @@ const propTypes = {
dropdownDirection: PropTypes.oneOf(Object.values(DropdownDirection)),
/** Header to display above table for accessibility reasons. */
header: props => {
if (!props['aria-label'] && !props.caption && !props.header) {
if (!props['aria-label'] && !props.caption && !props.header && !props.role === 'presentation') {
throw new Error('Specify at least one of: header, caption, aria-label');
}
return null;
},
/** Caption to display in table for accessibility reasons. */
caption: props => {
if (!props['aria-label'] && !props.caption && !props.header) {
if (!props['aria-label'] && !props.caption && !props.header && !props.role === 'presentation') {
throw new Error('Specify at least one of: header, caption, aria-label');
}
return null;
},
/** aria-label in table for accessibility reasons. */
'aria-label': props => {
if (!props['aria-label'] && !props.caption && !props.header) {
if (!props['aria-label'] && !props.caption && !props.header && !props.role === 'presentation') {
throw new Error('Specify at least one of: header, caption, aria-label');
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,7 @@ class VirtualGrid extends React.PureComponent<Props, State> {
if (childrenToDisplay.length > 0) {
const innerScrollContainerProps = {
className: 'ReactVirtualized__VirtualGrid__innerScrollContainer',
key: 'ReactVirtualized__VirtualGrid__innerScrollContainer',
role: containerRole,
style: {
width: autoContainerWidth ? 'auto' : totalColumnsWidth,
Expand Down

0 comments on commit 13f5211

Please sign in to comment.