@workday/canvas-kit-react
Version:
The parent module that contains all Workday Canvas Kit React components
27 lines • 1.16 kB
TypeScript
import React from 'react';
/**
* Disables body scroll by adding `overflow: hidden` to the body element. This effectively prevents
* page scrolling while the popup is visible.
*
* This should be used with popup elements that hide all other content and force the user to accept
* or dismiss the popup before continuing (i.e. Modals).
*/
export declare const useDisableBodyScroll: 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=useDisableBodyScroll.d.ts.map