Skip to content

Commit 6c8e457

Browse files
committed
feat: add afterOpen prop
1 parent 21a143a commit 6c8e457

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"rc-util": "^5.6.1"
5454
},
5555
"devDependencies": {
56+
"@types/classnames": "^2.2.11",
5657
"@types/enzyme": "^3.10.7",
5758
"@types/jest": "^26.0.14",
5859
"@types/react": "^16.9.2",

src/Dialog/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export default function Dialog(props: IDialogChildProps) {
3232
wrapClassName,
3333
wrapProps,
3434
onClose,
35+
afterOpen,
3536
afterClose,
3637

3738
// Dialog
@@ -68,6 +69,7 @@ export default function Dialog(props: IDialogChildProps) {
6869
lastOutSideActiveElementRef.current = document.activeElement as HTMLElement;
6970
contentRef.current?.focus();
7071
}
72+
afterOpen?.();
7173
} else {
7274
// Clean up scroll bar & focus back
7375
setAnimatedVisible(false);

src/IDialogPropTypes.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export type IDialogPropTypes = {
88
mask?: boolean;
99
children?: any;
1010
afterClose?: () => any;
11+
afterOpen?: () => any;
1112
onClose?: (e: SyntheticEvent) => any;
1213
closable?: boolean;
1314
maskClosable?: boolean;

0 commit comments

Comments
 (0)