Skip to content

Commit

Permalink
Reopen facebook#22481 Fixed modal closing issue (facebook#22484)
Browse files Browse the repository at this point in the history
Co-authored-by: Brian Vaughn <brian.david.vaughn@gmail.com>
  • Loading branch information
2 people authored and zhengjitf committed Apr 15, 2022
1 parent 2eb9bfd commit 81f0284
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react-devtools-shared/src/devtools/views/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export function useModalDismissSignal(
ownerDocument = ((modalRef.current: any): HTMLDivElement).ownerDocument;
ownerDocument.addEventListener('keydown', handleDocumentKeyDown);
if (dismissOnClickOutside) {
ownerDocument.addEventListener('click', handleDocumentClick);
ownerDocument.addEventListener('click', handleDocumentClick, true);
}
}, 0);

Expand All @@ -250,7 +250,7 @@ export function useModalDismissSignal(

if (ownerDocument !== null) {
ownerDocument.removeEventListener('keydown', handleDocumentKeyDown);
ownerDocument.removeEventListener('click', handleDocumentClick);
ownerDocument.removeEventListener('click', handleDocumentClick, true);
}
};
}, [modalRef, dismissCallback, dismissOnClickOutside]);
Expand Down

0 comments on commit 81f0284

Please sign in to comment.