Skip to content

Commit

Permalink
Merge pull request #22 from courseload/fix-tabindex-0
Browse files Browse the repository at this point in the history
Ensure elements with a tabIndex is set to 0 are considered interactive.
  • Loading branch information
kloots committed May 12, 2015
2 parents 069ab87 + f33cb44 commit 870237a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lib/__tests__/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ describe('props', () => {
<div onClick={k} tabIndex="0"/>;
});
});

it('does not warn when tabIndex is present', () => {
doNotExpectWarning(assertions.props.onClick.NO_TABINDEX.msg, () => {
<div onClick={k} tabIndex={0}/>;
});
});
});

describe('when element is interactive', () => {
Expand Down
2 changes: 1 addition & 1 deletion lib/assertions.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ exports.props = {
test (tagName, props, children) {
return !(
!isInteractive(tagName, props) &&
!props.tabIndex
props.tabIndex == null // tabIndex={0} is valid
);
}
},
Expand Down

0 comments on commit 870237a

Please sign in to comment.