Skip to content

How to get scrollable element with OverlayScrollbarsComponent (react)? #476

Answered by KingSora
krutoo asked this question in Q&A
Discussion options

You must be logged in to vote

Good day @krutoo
So for overlayscrollbars-react v0.3.0 and below (the ones compatible with v1) you have to do this:

  1. Get the ref to the component
  2. Then call ref.current.osInstance().getElements().viewport

This will give you the viewport element which is responsible for scrolling.

I highly recommend to update to v2 though.. (there the process is similar, just call elements() instead of getElements())

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@krutoo
Comment options

Answer selected by krutoo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants