Skip to content

Commit 23bcfba

Browse files
feat(@clayui/modal): do not set a default opener, ClayPortal handles it
1 parent 58a5bc5 commit 23bcfba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/clay-modal/src/Modal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const ClayModal: React.FunctionComponent<IProps> = ({
6969
children,
7070
className,
7171
observer,
72-
opener = document.body,
72+
opener,
7373
size,
7474
spritemap,
7575
status,
@@ -78,7 +78,7 @@ const ClayModal: React.FunctionComponent<IProps> = ({
7878
}: IProps) => {
7979
const modalElementRef = useRef<HTMLDivElement | null>(null);
8080
const modalBodyElementRef = useRef<HTMLDivElement | null>(null);
81-
const openerRef = useRef< Element| null>(opener);
81+
const openerRef = useRef< Element| null>(opener ? opener : null);
8282

8383
warning(observer !== undefined, warningMessage);
8484

0 commit comments

Comments
 (0)