@carbon/ibm-products
Version:
Carbon for IBM Products
16 lines (12 loc) • 495 B
JavaScript
/**
* Copyright IBM Corp. 2020, 2025
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
;
// Returns an array of focusable elements
const getFocusableElements = element => {
return [...element.querySelectorAll('a, button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])')].filter(e => !e.hasAttribute('disabled'));
};
exports.getFocusableElements = getFocusableElements;