Reactdevtools -----> Modal deleting filter fix #22481
Closed
+3
−1
Conversation
bvaughn
requested changes
Oct 1, 2021
| @@ -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); | |||
You need to add this param to the removeEventListener call below too:
ownerDocument.removeEventListener('click', handleDocumentClick, true);|
Messed up will pull another one ! |
bvaughn
requested changes
Oct 1, 2021
| ownerDocument.addEventListener('click', handleDocumentClick, true); | ||
| ownerDocument.addEventListener('click', handleDocumentClick); | ||
| ownerDocument.removeEventListener('click', handleDocumentClick,true); | ||
|
|
Sorry. This is not what I meant.
We add event listeners in the effects body and we remove them in the cleanup function the effect returns.
We need to add the new useCapture param to both places not just addEventListener
Suggested change
| ownerDocument.addEventListener('click', handleDocumentClick, true); |
ok @bvaughn i closed this one as i messed up the repo will be pulling another pr now
bvaughn
added a commit
that referenced
this issue
Oct 2, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
whats the problem?
As you can see in below when we try to delete the last filter index , it closes the whole modal but rather it should just delete the last filter this PR fixes this issue

Fixed-

The text was updated successfully, but these errors were encountered: