-
Notifications
You must be signed in to change notification settings - Fork 776
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tabindex): don't error when tabindex property is overridden (#1910)
* fix(tabindex): dont error when tabindex attribute is overridden * solve for NaN * add radix * test rolling build
- Loading branch information
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
return node.tabIndex <= 0; | ||
const tabIndex = parseInt(node.getAttribute('tabindex'), 10); | ||
|
||
// an invalid tabindex will either return 0 or -1 (based on the element) so | ||
// will never be above 0 | ||
// @see https://www.w3.org/TR/html51/editing.html#the-tabindex-attribute | ||
return isNaN(tabIndex) ? true : tabIndex <= 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters