question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scrollbar is not Clickable

See original GitHub issue

Overview of the problem

I’m using react-rnd version [10.1.10]

My browser is: Chrome (83.0.4103.116)

I am sure this issue is not a duplicate?

Reproduced project

https://codesandbox.io/s/confident-hill-oee4i

Description

The scrollbar is not clickable when overflow is auto

Although it’s visible

image

and its style change when we hover over it

image

we can’t click on it

Steps to Reproduce

  1. Go to https://codesandbox.io/s/confident-hill-oee4i
  2. Try to scroll by clicking on the scrollbar
  3. Moving the style into the <Rnd /> component doesn’t fix it

Expected behavior

For the content to scroll when the scrollbar buttons and bar are clicked

Actual behavior

Nothing happens, although the DOM indicates that the dragging starts by adding the react-draggable-dragging class to the draggable component

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:7
  • Comments:5

github_iconTop GitHub Comments

1reaction
SantiMe1commented, Aug 9, 2022

To whomever is still struggling with this in 2022:) As mentioned above, listen to the mousedown event in the container that has scrollbars. Check if the click happened in the scrollbar space and stop it from propagating.

const isScrollbarClicked = (e: MouseEvent<HTMLElement>): boolean => {
  const target = e.target as Element
  return (
    e.nativeEvent.offsetX > target.clientWidth ||
    e.nativeEvent.offsetY > target.clientHeight
  )
}

...
if (isScrollbarClicked(ev)) ev.stopPropagation()

This fix won’t work on Mac, since there’s no reserved space for scrollbars there.

0reactions
sirajabbascommented, Sep 27, 2022

Cancel prop resolves the drag conflicts.

cancel="button, svg, textarea, .targetClass etc..."

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scrollbar not clickable/draggable - Stack Overflow
I have a small issue on a website, where a block inside the website has overflow:scroll with a set ...
Read more >
Settings page vertical scrollbar is not clickable when mouse ...
Settings page scrollbar seems to have a ~1px margin to its right that prevents it from being pressed when the mouse cursor is...
Read more >
Scroll bar not working correctly in HTML editor of... - ServiceNow
Hi, In Tokyo version, the scroll bar is not showing the small triangle on either top or bottom. The scroll bar is not...
Read more >
Applying CSS styles from Site Settings for Scrollbar Not Working
Hello! I am trying to apply styles for the scrollbar by placing the custom CSS code in the Settings section of the site...
Read more >
Many features including scrollbar not working on certain ...
I am having an issue with many features of Visual Studio 2019 intermittently not working. Some of these issues are: -I cannot type...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found