Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DismissableLayer] Fix race condition between layers closing at the same time #3425

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

trevorharwell
Copy link

@trevorharwell trevorharwell commented Mar 20, 2025

Description

I encountered a bug where multiple layers closing at the same time would both determine that context.layersWithOutsidePointerEventsDisabled.size > 1 which prevented the pointer events from being reset back to it's original value. By moving the context.layersWithOutsidePointerEventsDisabled.delete(node) to inside of the clean up method for the outer events hook, the race condition is resolved.

I see the comment about "We purposefully prevent combining this effect with the disableOutsidePointerEvents effect" which this PR might not be aligned with. My thought is that the context.layers could represent the "creation order" while context.layersWithOutsidePointerEventsDisabled would not need to adhere to that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant