@carbon/ibm-products
Version:
Carbon for IBM Products
20 lines (18 loc) • 682 B
JavaScript
/**
* Copyright IBM Corp. 2020, 2026
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
//#region src/global/js/utils/getFocusableElements.js
/**
* Copyright IBM Corp. 2021, 2021
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
const getFocusableElements = (element) => {
return [...element.querySelectorAll("a, button, input, textarea, select, details,[tabindex]:not([tabindex=\"-1\"])")].filter((e) => !e.hasAttribute("disabled"));
};
//#endregion
exports.getFocusableElements = getFocusableElements;