diff --git a/src/components/Button.tsx b/src/components/Button.tsx index 3a50ea2643..a43bc552e1 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -122,11 +122,13 @@ export const Button = React.forwardRef( }, ref, ) => { - // This will pick the correct default pressable to use. If we are inside a dialog, we need to use the RNGH - // pressable so that it is usable inside the dialog. - const {insideDialog} = useDialogContext() + /* + * This will pick the correct default pressable to use. If we are inside a + * native dialog, we need to use the RNGH pressable. + */ + const {isNativeDialog} = useDialogContext() if (!PressableComponent) { - if (insideDialog) { + if (isNativeDialog) { PressableComponent = NormalizedRNGHPressable } else { PressableComponent = Pressable diff --git a/src/components/Dialog/context.ts b/src/components/Dialog/context.ts index 058d09b25d..6247b6d3d1 100644 --- a/src/components/Dialog/context.ts +++ b/src/components/Dialog/context.ts @@ -10,8 +10,8 @@ import {BottomSheetSnapPoint} from '../../../modules/bottom-sheet/src/BottomShee export const Context = React.createContext({ close: () => {}, - insideDialog: false, - snapPoint: BottomSheetSnapPoint.Hidden, + isNativeDialog: false, + nativeSnapPoint: BottomSheetSnapPoint.Hidden, }) export function useDialogContext() { diff --git a/src/components/Dialog/index.tsx b/src/components/Dialog/index.tsx index 18b4b7889d..cb2e37ac7e 100644 --- a/src/components/Dialog/index.tsx +++ b/src/components/Dialog/index.tsx @@ -111,7 +111,7 @@ export function OuterWithoutPortal({ ) const context = React.useMemo( - () => ({close, insideDialog: true, snapPoint}), + () => ({close, isNativeDialog: true, nativeSnapPoint: snapPoint}), [close, snapPoint], ) @@ -160,12 +160,12 @@ export function Inner({children, style}: DialogInnerProps) { export const ScrollableInner = React.forwardRef( function ScrollableInner({children, style}, ref) { const insets = useSafeAreaInsets() - const {snapPoint} = useDialogContext() + const {nativeSnapPoint} = useDialogContext() return ( + bounces={nativeSnapPoint === BottomSheetSnapPoint.Full}> {children} diff --git a/src/components/Dialog/index.web.tsx b/src/components/Dialog/index.web.tsx index a50e960a8a..3d860f112b 100644 --- a/src/components/Dialog/index.web.tsx +++ b/src/components/Dialog/index.web.tsx @@ -103,7 +103,8 @@ export function Outer({ const context = React.useMemo( () => ({ close, - insideDialog: true, + isNativeDialog: false, + nativeSnapPoint: 0, }), [close], ) diff --git a/src/components/Dialog/types.ts b/src/components/Dialog/types.ts index a964f29c89..2fd4d7c05a 100644 --- a/src/components/Dialog/types.ts +++ b/src/components/Dialog/types.ts @@ -38,8 +38,8 @@ export type DialogControlProps = DialogControlRefProps & { export type DialogContextProps = { close: DialogControlProps['close'] - insideDialog: boolean - snapPoint: BottomSheetSnapPoint + isNativeDialog: boolean + nativeSnapPoint: BottomSheetSnapPoint } export type DialogControlOpenOptions = {