1/**
2 * Gets keyboard-focusable elements within a specified element
3 * @param {HTMLElement} [element=document] element
4 * @returns {Array}
5 */
6function getKeyboardFocusableElements (element = document) {
7 return [...element.querySelectorAll(
8 'a, button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])'
9 )]
10 .filter(el => !el.hasAttribute('disabled'))
11}
12