luhn-generator
Version:
A generator of numbers that passes the validation of Luhn algorithm or Luhn formula, also known as the 'modulus 10' or 'mod 10' algorithm
36 lines (30 loc) • 769 B
JavaScript
import { hasContentVirtual } from '../commons/dom';
import { querySelectorAll, getScroll } from '../core/utils';
function scrollableRegionFocusableMatches(node, virtualNode) {
/**
* Note:
* `excludeHidden=true` for this rule, thus considering only elements in the accessibility tree.
*/
/**
* if not scrollable -> `return`
*/
if (!!getScroll(node, 13) === false) {
return false;
}
/**
* check if node has visible contents
*/
const nodeAndDescendents = querySelectorAll(virtualNode, '*');
const hasVisibleChildren = nodeAndDescendents.some(elm =>
hasContentVirtual(
elm,
true, // noRecursion
true // ignoreAria
)
);
if (!hasVisibleChildren) {
return false;
}
return true;
}
export default scrollableRegionFocusableMatches;