From 13f52117452bcc9f83ebfa2e5ed2b25e0f4e3819 Mon Sep 17 00:00:00 2001 From: Patrick Riley Date: Fri, 24 May 2019 12:14:37 -0400 Subject: [PATCH] allow null aria-label for role presentation, add key to virtual grid --- .../patternfly-4/react-table/src/components/Table/Table.js | 6 +++--- .../src/components/Virtualized/VirtualGrid.js | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/patternfly-4/react-table/src/components/Table/Table.js b/packages/patternfly-4/react-table/src/components/Table/Table.js index 6fd77bdcbfc..7bfdd34f9a9 100644 --- a/packages/patternfly-4/react-table/src/components/Table/Table.js +++ b/packages/patternfly-4/react-table/src/components/Table/Table.js @@ -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; diff --git a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/VirtualGrid.js b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/VirtualGrid.js index 5fdb0ebdbc8..34ad6d9d32e 100644 --- a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/VirtualGrid.js +++ b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/VirtualGrid.js @@ -989,6 +989,7 @@ class VirtualGrid extends React.PureComponent { if (childrenToDisplay.length > 0) { const innerScrollContainerProps = { className: 'ReactVirtualized__VirtualGrid__innerScrollContainer', + key: 'ReactVirtualized__VirtualGrid__innerScrollContainer', role: containerRole, style: { width: autoContainerWidth ? 'auto' : totalColumnsWidth,