From 2d624788bea5a7ba644522df54d5da53c7ba68ed Mon Sep 17 00:00:00 2001 From: viraj-10 Date: Thu, 19 Sep 2024 17:34:03 +0530 Subject: [PATCH] feat: updated prop position --- packages/unstyled/actionsheet/src/Actionsheet.tsx | 3 +++ packages/unstyled/actionsheet/src/ActionsheetContent.tsx | 2 +- packages/unstyled/actionsheet/src/context.ts | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/unstyled/actionsheet/src/Actionsheet.tsx b/packages/unstyled/actionsheet/src/Actionsheet.tsx index ea32b013a2..dd4acf3fb7 100644 --- a/packages/unstyled/actionsheet/src/Actionsheet.tsx +++ b/packages/unstyled/actionsheet/src/Actionsheet.tsx @@ -24,6 +24,7 @@ export function Actionsheet(StyledActionsheet: React.ComponentType) { snapPoints, // @ts-ignore _experimentalOverlay = false, + preventScroll = false, ...props }: T & IActionsheetProps, ref?: any @@ -64,6 +65,7 @@ export function Actionsheet(StyledActionsheet: React.ComponentType) { initialFocusRef, finalFocusRef, snapPoints, + preventScroll, }; }, [ handleClose, @@ -75,6 +77,7 @@ export function Actionsheet(StyledActionsheet: React.ComponentType) { initialFocusRef, finalFocusRef, snapPoints, + preventScroll, ]); return ( diff --git a/packages/unstyled/actionsheet/src/ActionsheetContent.tsx b/packages/unstyled/actionsheet/src/ActionsheetContent.tsx index ff0aa8fff7..36f6ab62e6 100644 --- a/packages/unstyled/actionsheet/src/ActionsheetContent.tsx +++ b/packages/unstyled/actionsheet/src/ActionsheetContent.tsx @@ -27,7 +27,6 @@ function ActionsheetContent( children, _experimentalContent = false, focusScope = true, - preventScroll = true, ...props }: any, ref?: any @@ -40,6 +39,7 @@ function ActionsheetContent( handleCloseBackdrop, finalFocusRef, snapPoints, + preventScroll, } = React.useContext(ActionsheetContext); usePreventScroll({ isDisabled: preventScroll }); diff --git a/packages/unstyled/actionsheet/src/context.ts b/packages/unstyled/actionsheet/src/context.ts index 8532f03bbf..5332a02c03 100644 --- a/packages/unstyled/actionsheet/src/context.ts +++ b/packages/unstyled/actionsheet/src/context.ts @@ -13,4 +13,5 @@ export const ActionsheetContext = React.createContext({ bottomInset: 0 as number, trapFocus: true as boolean, snapPoints: [] as Array, + preventScroll: true as boolean, });