@mocanvas/mocanvas · function
declare function useDismissable(open: boolean, layerRef: RefObject<HTMLElement | null>, anchorRef: RefObject<HTMLElement | null>, onClose: () => void,
/** Also treat these as "inside": the layers this one opened. */
containsNested?: (target: Node) => boolean): voidClose on Escape or on a pointer press outside both the layer and its anchor.
Listens in the capture phase so it wins against a canvas handler that would otherwise start a gesture on the same press.
mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.