@nextui-org/use-aria-modal-overlay
Advanced tools
Comparing version 0.0.0-dev-v2-20240416125016 to 0.0.0-dev-v2-20240416163640
@@ -7,5 +7,7 @@ import { AriaModalOverlayProps, ModalOverlayAria } from '@react-aria/overlays'; | ||
} | ||
declare function useAriaModalOverlay(props: UseAriaModalOverlayProps | undefined, state: OverlayTriggerState, ref: RefObject<HTMLElement>): ModalOverlayAria; | ||
declare function useAriaModalOverlay(props: (UseAriaModalOverlayProps & { | ||
shouldBlockScroll?: boolean | undefined; | ||
}) | undefined, state: OverlayTriggerState, ref: RefObject<HTMLElement>): ModalOverlayAria; | ||
type UseAriaModalOverlayReturn = ReturnType<typeof useAriaModalOverlay>; | ||
export { UseAriaModalOverlayProps, UseAriaModalOverlayReturn, useAriaModalOverlay }; |
@@ -29,3 +29,5 @@ "use strict"; | ||
var import_react = require("react"); | ||
function useAriaModalOverlay(props = {}, state, ref) { | ||
function useAriaModalOverlay(props = { | ||
shouldBlockScroll: true | ||
}, state, ref) { | ||
let { overlayProps, underlayProps } = (0, import_overlays.useOverlay)( | ||
@@ -39,2 +41,5 @@ { | ||
); | ||
(0, import_overlays.usePreventScroll)({ | ||
isDisabled: !state.isOpen || !props.shouldBlockScroll | ||
}); | ||
(0, import_overlays.useOverlayFocusContain)(); | ||
@@ -41,0 +46,0 @@ (0, import_react.useEffect)(() => { |
{ | ||
"name": "@nextui-org/use-aria-modal-overlay", | ||
"version": "0.0.0-dev-v2-20240416125016", | ||
"version": "0.0.0-dev-v2-20240416163640", | ||
"description": "A custom implementation of react aria modal overlay, this removes the prevent scroll", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
6482
103