Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function findTabbable (el, shouldSearchRootNode) {
warn(false, '[findTabbable] is deprecated. It has been moved from `@instructure/ui-a11y` to `@instructure/ui-dom-utils`')
return findFocusable(el, (element) => {
return !isInvalidTabIndex(element.getAttribute('tabindex'))
}, shouldSearchRootNode)
}
function findFocusable (el, filter, shouldSearchRootNode) {
warn(false, '[findFocusable] is deprecated. It has been moved from `@instructure/ui-a11y` to `@instructure/ui-dom-utils`')
const element = findDOMNode(el)
if (!element || typeof element.querySelectorAll !== 'function') {
return []
}
const focusableSelector = 'a[href],frame,iframe,object,input:not([type=hidden]),select,textarea,button,*[tabindex]'
let matches = Array.from(element.querySelectorAll(focusableSelector))
if (shouldSearchRootNode && elementMatches(element, focusableSelector)) {
matches = [...matches, element]
}
return matches.filter((el) => {
function hasVisibleChildren (children) {
warn(false, '[hasVisibleChildren] is deprecated. It has been moved from `@instructure/ui-a11y` to `@instructure/ui-a11y-utils`')
let visible = false
React.Children.forEach(children, (child) => {
if (child && !matchComponentTypes(child, [ScreenReaderContent])) {
visible = true
}
})
return visible
}