diff --git a/docs/PROPS.md b/docs/PROPS.md index b86aca16..09ee6276 100644 --- a/docs/PROPS.md +++ b/docs/PROPS.md @@ -263,6 +263,14 @@ Define where the handle on top of the modal should be positioned. | ------------------------- | -------- | --------- | | enum('outside', 'inside') | No | `outside` | +### `initialDest` + +Define which position the modal should be started. + +| Type | Required | Default | +| ------------------------- | -------- | --------- | +| enum('default', 'top') | No | `default` | + ### `disableScrollIfPossible` Disable the scroll when the content is shorter than screen's height. diff --git a/src/index.tsx b/src/index.tsx index 62eaa830..af50ff04 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -87,6 +87,7 @@ const ModalizeBase = ( // Options handlePosition = 'outside', + initialDest = 'default', disableScrollIfPossible = true, avoidKeyboardLikeIOS = Platform.select({ ios: true, @@ -858,7 +859,7 @@ const ModalizeBase = ( React.useEffect(() => { if (alwaysOpen && (modalHeightValue || adjustToContentHeight)) { - handleAnimateOpen(alwaysOpen); + handleAnimateOpen(alwaysOpen, initialDest); } }, [alwaysOpen, modalHeightValue]); diff --git a/src/options.ts b/src/options.ts index d9a4d964..041ee9df 100644 --- a/src/options.ts +++ b/src/options.ts @@ -129,6 +129,12 @@ export interface IProps { */ handlePosition?: 'outside' | 'inside'; + /** + * Define which position the modal should be started. + * @default 'default' + */ + initialDest?: TOpen; + /** * Disable the scroll when the content is shorter than screen's height. * @default true