Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

551 B
Raw Blame
import type { SyntheticEvent } from 'react';

/**
 * Whether an event started inside the handling element's own DOM. React bubbles events along the component tree, so one
 * from portalled content a descendant opened (a popover, menu, or tooltip) also reaches ancestors whose DOM does not
 * hold it. A handler acting for its own surface, such as a region's right-click menu, ignores those.
 */
export const isEventFromOwnDom = (event: SyntheticEvent<Element>): boolean =>
  event.target instanceof Node && event.currentTarget.contains(event.target);