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

ScrollArea doesn't always reset blocking pointer events on body tag #6681

Closed
1 of 2 tasks
t-vince opened this issue Aug 16, 2024 · 1 comment
Closed
1 of 2 tasks

ScrollArea doesn't always reset blocking pointer events on body tag #6681

t-vince opened this issue Aug 16, 2024 · 1 comment
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)

Comments

@t-vince
Copy link

t-vince commented Aug 16, 2024

Dependencies check up

  • I have verified that I use latest version of all @mantine/* packages

What version of @mantine/* packages do you have in package.json?

7.12.0

What package has an issue?

@mantine/core

What framework do you use?

Vite

In which browsers you can reproduce the issue?

Chrome

Describe the bug

In the ScrollArea component when scrolling, pointer-events are set to none and when scrolling stops this is reset back to auto.
This behavior happens since bd6fad3 with

onPointerDown={composeEventHandlers(props.onPointerUp, (event) => {
          [...]
          document.body.style.pointerEvents = 'none';

and gets reset with

onPointerUp={composeEventHandlers(props.onPointerUp, (event) => {
          [...]
          document.body.style.pointerEvents = 'auto';

However, this does not always work reliably. When clicking next to the scrollbar after scrolling, it can cause it to not reset the this pointer event, which makes it seem that the whole page freezes as it no longer takes pointer input. Only way to make the page function again is to remove the pointer-events: none; from the body tag or refreshing the page.

The last version where this is not reproducible is 7.10.1 (the version before the mentioned commit)
It is also reproducible on the mantine website, on the ScrollArea page

Screen.Recording.2024-08-16.at.15.58.56.mp4

If possible, include a link to a codesandbox with a minimal reproduction

No response

Possible fix

It seems that the pointerUp event is not always correctly triggered. I'd propose to just revert the pointer-events on body PR, make this optional so people can opt-out or scope it to the scrollArea instead of the body tag. Currently it's quite risky; when it fails, it disables the complete page and not just the ScrollArea component.

Self-service

  • I would be willing to implement a fix for this issue
rtivital added a commit that referenced this issue Aug 26, 2024
@rtivital rtivital added the Fixed patch Completed issues that will be published with next patch (1.0.X) label Aug 26, 2024
@rtivital
Copy link
Member

Fixed in 7.12.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)
Projects
None yet
Development

No branches or pull requests

2 participants