1/** 2 * Returns back a NodeList of focusable elements 3 * that exist within the passed parnt HTMLElement 4 * 5 * @param {HTMLElement} parent HTML element 6 * @returns {NodeList} The focusable elements that we can find 7 */ 8export default (parent) => { 9 if (!parent) { 10 console.warn("You need to pass a parent HTMLElement"); 11 return []; 12 } 13 14 return parent.querySelectorAll( 15 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)' 16 ); 17};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.