MCPcopy Create free account
hub / github.com/reactjs/react-modal / focusable

Function focusable

src/helpers/tabbable.js:62–68  ·  view source on GitHub ↗
(element, isTabIndexNotNaN)

Source from the content-addressed store, hash-verified

60}
61
62function focusable(element, isTabIndexNotNaN) {
63 const nodeName = element.nodeName.toLowerCase();
64 const res =
65 (tabbableNode.test(nodeName) && !element.disabled) ||
66 (nodeName === "a" ? element.href || isTabIndexNotNaN : isTabIndexNotNaN);
67 return res && visible(element);
68}
69
70function tabbable(element) {
71 let tabIndex = element.getAttribute("tabindex");

Callers 1

tabbableFunction · 0.85

Calls 1

visibleFunction · 0.85

Tested by

no test coverage detected