Skip to content

Commit

Permalink
feat: allow open alwaysOpen modal to default position
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremybarbet committed Mar 23, 2020
1 parent 88f86cc commit bed354e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,14 @@ export class Modalize<FlatListItem = any, SectionListItem = any> extends React.C
}

public open = (dest: TOpen): void => {
const { onOpen } = this.props;
const { onOpen, alwaysOpen } = this.props;
const initial = alwaysOpen && dest === 'default' ? alwaysOpen : undefined;

if (onOpen) {
onOpen();
}

this.onAnimateOpen(undefined, dest);
this.onAnimateOpen(initial, dest);
};

public close = (dest: TClose = 'default'): void => {
Expand Down

0 comments on commit bed354e

Please sign in to comment.