export function isFocusable()

in src/focus/dom-utils.ts [39:58]


export function isFocusable(
  el: HTMLElement,
  activeElement = instance.getServices().elementStore.element,
): boolean {
  if (el === activeElement) {
    return false;
  }
  // to prevent navigating to parent container elements with arc-focus-inside
  if (activeElement !== document.body && activeElement.contains(el)) {
    return false;
  }

  // Dev note: el.tabindex is not consistent across browsers
  const tabIndex = el.getAttribute('tabIndex');
  if (!tabIndex || +tabIndex < 0) {
    return false;
  }

  return isVisible(el);
}