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

[AlertDialog][ContextMenu][Dialog][Popover][DropdownMenu] Fix pointer-events reset #819

Merged
merged 1 commit into from Aug 11, 2021

Conversation

jjenzz
Copy link
Contributor

@jjenzz jjenzz commented Aug 11, 2021

Pointer events were not resetting correctly when pop ups were opening from within other pop ups. This was initially reported here regarding Dropdown/Dialog composition: https://discord.com/channels/752614004387610674/803656530259738674/874553651417477162

This change ensures we decrease the count at the same time as the reset (when the unmount events have executed).

@jjenzz jjenzz merged commit b824891 into main Aug 11, 2021
@jjenzz jjenzz deleted the body-pointer-events-fix branch August 11, 2021 12:29
@garand
Copy link

garand commented Aug 12, 2021

👀 👀 👀

Seems like this would fix this? https://codesandbox.io/s/friendly-noyce-rin40

@andy-hook
Copy link
Collaborator

Seems like this would fix this?

Yep, this change resolves it 👍

@@ -33,6 +33,7 @@ function useBodyPointerEvents({ disabled }: { disabled: boolean }) {
}

function resetPointerEvents() {
changeCount--;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's my bad on this one, when we rejigged the code before I went on holidays I didn't catch that this bit wasn't moved with it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, my fault for not moving it 😅 complete oversight.

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.

None yet

4 participants