From 90d6b2bcbea88647855adf7026688d78b725f417 Mon Sep 17 00:00:00 2001 From: Ben Biggs Date: Wed, 29 Jul 2020 11:46:16 -0500 Subject: [PATCH] fix(list): allow ariaConfig to be a boolean --- react/src/lib/List/index.js | 11 +++++++---- .../Popover/tests/__snapshots__/index.spec.js.snap | 2 -- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/react/src/lib/List/index.js b/react/src/lib/List/index.js index e1635cafa6..0b2d133320 100644 --- a/react/src/lib/List/index.js +++ b/react/src/lib/List/index.js @@ -249,7 +249,7 @@ class List extends React.Component { return; this.setFocus(items, index); - + // Don't do anything if onSelect Event Handler is present if (onSelect) { return onSelect(e, { @@ -426,7 +426,10 @@ List.propTypes = { PropTypes.number ]), /** @prop Optional parameter for accessibility configuration | null */ - ariaConfig: PropTypes.object, + ariaConfig: PropTypes.oneOfType([ + PropTypes.bool, + PropTypes.object, + ]), /** @prop Children nodes to render inside List | null */ children: PropTypes.node, /** @prop Optional css class string | '' */ @@ -447,7 +450,7 @@ List.propTypes = { navigationDirection: PropTypes.oneOf(['vertical', 'horizontal', 'both']), /** @prop Callback function invoked by user selecting an interactive item within List | null */ onSelect: PropTypes.func, - /** @prop Disables the stopPropagation() & preventDefault() for ArrowKey Events | false */ + /** @prop Disables the stopPropagation() & preventDefault() for ArrowKey Events | false */ shouldPropagateKeyDown: PropTypes.bool, /** @prop Sets the ARIA role for the Nav, in the context of a TabContainer | 'list' */ role: PropTypes.string, @@ -493,4 +496,4 @@ List.defaultProps = { List.displayName = 'List'; -export default List; \ No newline at end of file +export default List; diff --git a/react/src/lib/Popover/tests/__snapshots__/index.spec.js.snap b/react/src/lib/Popover/tests/__snapshots__/index.spec.js.snap index 4bf2f55f0b..ef08ebf74e 100644 --- a/react/src/lib/Popover/tests/__snapshots__/index.spec.js.snap +++ b/react/src/lib/Popover/tests/__snapshots__/index.spec.js.snap @@ -64,7 +64,6 @@ ShallowWrapper { "children": "Hello", "onBlur": [Function], "onFocus": [Function], - "onKeyDown": undefined, "onMouseEnter": [Function], "onMouseLeave": [Function], }, @@ -104,7 +103,6 @@ ShallowWrapper { "children": "Hello", "onBlur": [Function], "onFocus": [Function], - "onKeyDown": undefined, "onMouseEnter": [Function], "onMouseLeave": [Function], },