Skip to content

Commit 5776dcb

Browse files
fixup! fixup! fixup! fixup! Re-implement Modal component using HTMLDialogElement (#461)
1 parent 157b858 commit 5776dcb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/components/Modal/Modal.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ export const Modal = ({
6262
internalDialogRef.current.showModal();
6363
}, []);
6464

65+
// We need to have a reference to the dialog element to be able to call its methods,
66+
// but at the same time we want to expose this reference to the parent component for
67+
// case someone wants to call dialog methods from outside the component.
6568
useImperativeHandle(dialogRef, () => internalDialogRef.current);
6669

6770
useModalFocus(autoFocus, internalDialogRef, primaryButtonRef);

0 commit comments

Comments
 (0)