Skip to content

Commit 81f0284

Browse files
Biki-dasbvaughn
authored andcommitted
Reopen facebook#22481 Fixed modal closing issue (facebook#22484)
Co-authored-by: Brian Vaughn <[email protected]>
1 parent 2eb9bfd commit 81f0284

File tree

1 file changed

+2
-2
lines changed
  • packages/react-devtools-shared/src/devtools/views

1 file changed

+2
-2
lines changed

packages/react-devtools-shared/src/devtools/views/hooks.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ export function useModalDismissSignal(
239239
ownerDocument = ((modalRef.current: any): HTMLDivElement).ownerDocument;
240240
ownerDocument.addEventListener('keydown', handleDocumentKeyDown);
241241
if (dismissOnClickOutside) {
242-
ownerDocument.addEventListener('click', handleDocumentClick);
242+
ownerDocument.addEventListener('click', handleDocumentClick, true);
243243
}
244244
}, 0);
245245

@@ -250,7 +250,7 @@ export function useModalDismissSignal(
250250

251251
if (ownerDocument !== null) {
252252
ownerDocument.removeEventListener('keydown', handleDocumentKeyDown);
253-
ownerDocument.removeEventListener('click', handleDocumentClick);
253+
ownerDocument.removeEventListener('click', handleDocumentClick, true);
254254
}
255255
};
256256
}, [modalRef, dismissCallback, dismissOnClickOutside]);

0 commit comments

Comments
 (0)