Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

364 B
Raw Blame
const IGNORE_OUTSIDE_INTERACTION_ATTRIBUTE = "data-ignore-outside-interaction";

const IGNORE_OUTSIDE_INTERACTION_SELECTOR = `[${IGNORE_OUTSIDE_INTERACTION_ATTRIBUTE}]`;

export function shouldIgnoreOutsideInteraction(target: EventTarget | null) {
  return (
    target instanceof Element &&
    Boolean(target.closest(IGNORE_OUTSIDE_INTERACTION_SELECTOR))
  );
}