Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tabindex): don't error when tabindex property is overridden #1910

Merged
merged 4 commits into from
Nov 21, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/checks/keyboard/tabindex.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
return node.tabIndex <= 0;
return node.getAttribute('tabindex') <= 0;
straker marked this conversation as resolved.
Show resolved Hide resolved
9 changes: 9 additions & 0 deletions test/checks/keyboard/tabindex.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,13 @@ describe('tabindex', function() {

assert.isTrue(checks.tabindex.evaluate(node));
});

it('should look at the attribute and not the property', function() {
straker marked this conversation as resolved.
Show resolved Hide resolved
var node = document.createElement('div');
node.setAttribute('tabindex', '1');
node.tabindex = null;
fixture.appendChild(node);

assert.isFalse(checks.tabindex.evaluate(node));
});
});