@workday/canvas-kit-react
Version:
The parent module that contains all Workday Canvas Kit React components
29 lines • 1.32 kB
TypeScript
import React from 'react';
/**
* Sets up an
* [IntersectionObserver](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API)
* for the target element. When the target is detected as being less than 50% visible, the popup
* will close. Most likely, this will happen if the user scrolls an overflowed content area of the
* page and the target is no longer visible.
*
* This should be used with popup elements that are transitory like Tooltips and dropdown menus.
*/
export declare const useCloseOnTargetHidden: 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=useCloseOnTargetHidden.d.ts.map