Skip to content

Commit

Permalink
Reopen #22481 Fixed modal closing issue (#22484)
Browse files Browse the repository at this point in the history
Co-authored-by: Brian Vaughn <[email protected]>
  • Loading branch information
Biki-das and bvaughn authored Oct 2, 2021
1 parent 5f3b376 commit a4bc8ae
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 a4bc8ae

Please sign in to comment.