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

Double Scrolling Bar #40

Closed
lucmerceron opened this issue Apr 8, 2016 · 4 comments
Closed

Double Scrolling Bar #40

lucmerceron opened this issue Apr 8, 2016 · 4 comments
Labels

Comments

@lucmerceron
Copy link

Good morning,

I'm pretty surprised to find a bug of this kind.
Perhaps i'm doing something wrong.

With the following code as example, if i scroll within the second scrollbar, the first one will scroll too.

<ScrollBar
  speed={0.8}
  style={{height: '400px'}}
  horizontal={false}
  smoothScrolling= {true}
  minScrollSize={40}>
  <div style={{height: '800px', padding: '40px', border: '1px solid grey'}}>
    <ScrollBar
      speed={0.8}
      style={{height: '200px'}}
      horizontal={false}
      smoothScrolling= {true}
      minScrollSize={40}>
        <div style={{height: '400px', padding: '40px', border: '1px solid,pink'backgroundColor: '#C2BFBF', color: 'white'}}>
      </div>
    </ScrollBar>
  </div>
</ScrollBar>

You can see the problem in this small video-clip : https://vid.me/qNTm

Thank for the answer,
Luc

@souhe
Copy link
Owner

souhe commented Apr 8, 2016

Hi,

That's interesting. Your code looks good and I think it might be a bug. I've never thought about nested ScrollAreas.

I'll try to fix that :)

@souhe souhe added the bug label Apr 8, 2016
@pterenin
Copy link

Caught this bug too. One option to fix it is to add event to onScrooll method. That way you could do event.preventDefault() when you scroll child element.

@wttubes
Copy link

wttubes commented May 12, 2016

I agree with @pterenin i was searching for event in onScroll method and couldn't find it.
I used jquery, on the inner scrollable div, in the componentDidMount method:

  ```
  let overflowDiv = $(".overflow");

  overflowDiv.on("mousewheel", function (e) {
      e.stopPropagation();
  });

@souhe
Copy link
Owner

souhe commented Sep 29, 2016

It's fixed thanks to @vsubbotskyy

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

No branches or pull requests

4 participants