@workday/canvas-kit-react
Version:
The parent module that contains all Workday Canvas Kit React components
25 lines • 1.18 kB
TypeScript
import React from 'react';
/**
* Registers global listener for all clicks. It will only call the PopupModel's `hide` event if the
* click happened outside the `[role=dialog]` of an overlay component. The difference between `useCloseOnOutsideClick`
* and `useCloseOnOverlayClick` is the Overlay is a child of a `stackRef` element and has a different
*/
export declare const useCloseOnOverlayClick: import("@workday/canvas-kit-react/common").BehaviorHook<{
state: {
stackRef: React.RefObject<HTMLDivElement>;
targetRef: React.RefObject<HTMLButtonElement>;
initialFocusRef: React.RefObject<any> | undefined;
returnFocusRef: React.RefObject<any> | undefined;
placement: import("@popperjs/core").Placement;
id: string;
visibility: "hidden" | "visible";
};
events: {
updatePlacement(data: {
placement: import("@popperjs/core").Placement;
}): void;
show(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
};
}, {}>;
//# sourceMappingURL=useCloseOnOverlayClick.d.ts.map