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

Scroll area scrollbar size is not being respected in the hover property #2610

Closed
suchintan opened this issue Oct 2, 2022 · 3 comments
Closed
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)

Comments

@suchintan
Copy link

suchintan commented Oct 2, 2022

What package has an issue

@mantine/core

Describe the bug

I noticed that the scroll bar's hover area is bigger than the actual scroll bar. This is causing a really unusual bug in my work where my float-right component is being hidden behind the scroll bar

You can actually reproduce this on the scroll area demo page here:
https://mantine.dev/core/scroll-area/

ScrollArea._.Mantine.-.2.October.2022.mp4

image

If you put your mouse even 10 pixels to the left of the scroll bar it still considers the scrollbar as "hovered", even if you reduce the size or set offset on

What version of @mantine/hooks page do you have in package.json?

5.2.4

If possible, please include a link to a codesandbox with the reproduced problem

No response

Do you know how to fix the issue

No

Are you willing to participate in fixing this issue and create a pull request with the fix

No

Possible fix

I'm not really sure what the cause of the issue is.. still a learning react developer 😅

@trangcongthanh
Copy link

I got the same problem, but this is default behavior of @radix-ui/react-scroll-area. For most cases, this is not an issue. It only becomes a problem when I try to use ScrollArea component for the UI with small height. When the thumb appeared, I couldn't click the content below :(

In my case, I unset the min-width/min-height of the thumb::before:

<ScrollArea styles={{ thumb: { ':before': { minHeight: 'unset', minWidth: 'unset' } } }} >

If you want to disable it globally, you can set the defaultProps for ScrollArea:

<MantineProvider
  theme={{
    components: { ScrollArea: { defaultProps: { styles: { thumb: { ':before': { minHeight: 'unset', minWidth: 'unset' } } } } } },
  }}
>

When you unset those values, your user with touch screens may find it harder to scroll the content by grabbing the thumb in scrollbar.

@rtivital rtivital added the Fixed patch Completed issues that will be published with next patch (1.0.X) label Oct 4, 2022
@rtivital
Copy link
Member

rtivital commented Oct 4, 2022

Fixed in 5.5.2

@rtivital rtivital closed this as completed Oct 4, 2022
@suchintan
Copy link
Author

Thank you @rtivital and @trangcongthanh !

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

3 participants