Skip to content

The open alternative to Salesforce, designed for AI.

354 B
Raw Blame
import { isActiveDropdownElement } from './isActiveDropdownElement';

export const getDropdownTrigger = (content: HTMLElement) =>
  Array.from(
    content.ownerDocument.querySelectorAll<HTMLElement>('[aria-controls]'),
  ).find(
    (trigger) =>
      trigger.getAttribute('aria-controls') === content.id &&
      isActiveDropdownElement(trigger),
  );