malte-wessel / react-custom-scrollbars

React scrollbars component
http://malte-wessel.github.io/react-custom-scrollbars/
MIT License
3.2k stars 577 forks source link

There is no method for Scroll end #355

Open takshch opened 4 years ago

takshch commented 4 years ago

There is no method for Scroll End. A function which will be called when scroll thumb is at end of track. I need to add infinity scroll feature. Tell me the solution if available.

itshallrun commented 4 years ago

Pass a callback to "onScrollFrame", it will give you the current position. Lsten for the values.top to figure out if the current scroll hit the end.

values.top: (Number) scrollTop progress, from 0 to 1

onScrollFrame: (Function) Runs inside the animation frame. Signature: onScroll(values) values: (Object) Values about the current position values.top: (Number) scrollTop progess, from 0 to 1 values.left: (Number) scrollLeft progess, from 0 to 1 values.clientWidth: (Number) Width of the view values.clientHeight: (Number) Height of the view values.scrollWidth: (Number) Native scrollWidth values.scrollHeight: (Number) Native scrollHeight values.scrollLeft: (Number) Native scrollLeft values.scrollTop: (Number) Native scrollTop