UNPKG

@ozen-ui/kit

Version:

React component library

19 lines (18 loc) 638 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getFocusableElements = void 0; var FOCUSABLE_SELECTOR = [ 'input:not([tabindex="-1"])', 'select', 'textarea', 'a[href]', 'button', '[tabindex]:not([tabindex="-1"])', 'audio[controls]', 'video[controls]', ]; var getFocusableElements = function (container, selector) { if (selector === void 0) { selector = FOCUSABLE_SELECTOR; } return Array.from(container.querySelectorAll(selector.join(','))).filter(function (el) { return !el.hasAttribute('disabled'); }); }; exports.getFocusableElements = getFocusableElements;