Skip to content

Commit 8f28daf

Browse files
committed
Merge pull request #25 from TxHawks/ignore-all-negative-tabindex
Ignore all negative tabindex values.
2 parents 94a971b + 877c35e commit 8f28daf

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

accessible-modal-dialog.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
// Helper function to get all focusable children from a node
55
function getFocusableChildren (node) {
6-
var focusableElements = ['a[href]', 'area[href]', 'input:not([disabled])', 'select:not([disabled])', 'textarea:not([disabled])', 'button:not([disabled])', 'iframe', 'object', 'embed', '[contenteditable]', '[tabindex]:not([tabindex="-1"])'];
6+
var focusableElements = ['a[href]', 'area[href]', 'input:not([disabled])', 'select:not([disabled])', 'textarea:not([disabled])', 'button:not([disabled])', 'iframe', 'object', 'embed', '[contenteditable]', '[tabindex]:not([tabindex^="-"])'];
77

88
return $$(focusableElements.join(','), node).filter(function (child) {
99
return !!(child.offsetWidth || child.offsetHeight || child.getClientRects().length);

accessible-modal-dialog.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
// Helper function to get all focusable children from a node
55
function getFocusableChildren (node) {
6-
var focusableElements = ['a[href]', 'area[href]', 'input:not([disabled])', 'select:not([disabled])', 'textarea:not([disabled])', 'button:not([disabled])', 'iframe', 'object', 'embed', '[contenteditable]', '[tabindex]:not([tabindex="-1"])'];
6+
var focusableElements = ['a[href]', 'area[href]', 'input:not([disabled])', 'select:not([disabled])', 'textarea:not([disabled])', 'button:not([disabled])', 'iframe', 'object', 'embed', '[contenteditable]', '[tabindex]:not([tabindex^="-"])'];
77

88
return $$(focusableElements.join(','), node).filter(function (child) {
99
return !!(child.offsetWidth || child.offsetHeight || child.getClientRects().length);

0 commit comments

Comments
 (0)