We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e1a822 commit 6cc467cCopy full SHA for 6cc467c
client/modules/IDE/components/Modal.jsx
@@ -16,13 +16,13 @@ const Modal = ({
16
17
const handleOutsideClick = (e) => {
18
// ignore clicks on the component itself
19
- if (e.path.includes(modalRef.current)) return;
+ if (modalRef.current?.contains?.(e.target)) return;
20
21
onClose();
22
};
23
24
useEffect(() => {
25
- modalRef.current.focus();
+ modalRef.current?.focus();
26
document.addEventListener('click', handleOutsideClick, false);
27
28
return () => {
0 commit comments