UNPKG

@carbon/ibm-products

Version:

Carbon for IBM Products

14 lines (11 loc) 460 B
/** * 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')); }; export { getFocusableElements };