Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/PROPS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ const ModalizeBase = (

// Options
handlePosition = 'outside',
initialDest = 'default',
disableScrollIfPossible = true,
avoidKeyboardLikeIOS = Platform.select({
ios: true,
Expand Down Expand Up @@ -858,7 +859,7 @@ const ModalizeBase = (

React.useEffect(() => {
if (alwaysOpen && (modalHeightValue || adjustToContentHeight)) {
handleAnimateOpen(alwaysOpen);
handleAnimateOpen(alwaysOpen, initialDest);
}
}, [alwaysOpen, modalHeightValue]);

Expand Down
6 changes: 6 additions & 0 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ export interface IProps<ListItem = any> {
*/
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
Expand Down