Skip to content

Commit

Permalink
fix(list): allow ariaConfig to be a boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
bfbiggs committed Jul 29, 2020
1 parent 5f4afe1 commit 90d6b2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 7 additions & 4 deletions react/src/lib/List/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down Expand Up @@ -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 | '' */
Expand All @@ -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,
Expand Down Expand Up @@ -493,4 +496,4 @@ List.defaultProps = {

List.displayName = 'List';

export default List;
export default List;
2 changes: 0 additions & 2 deletions react/src/lib/Popover/tests/__snapshots__/index.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ ShallowWrapper {
"children": "Hello",
"onBlur": [Function],
"onFocus": [Function],
"onKeyDown": undefined,
"onMouseEnter": [Function],
"onMouseLeave": [Function],
},
Expand Down Expand Up @@ -104,7 +103,6 @@ ShallowWrapper {
"children": "Hello",
"onBlur": [Function],
"onFocus": [Function],
"onKeyDown": undefined,
"onMouseEnter": [Function],
"onMouseLeave": [Function],
},
Expand Down

0 comments on commit 90d6b2b

Please sign in to comment.