2020-09-01 13:55:28 +00:00
|
|
|
/* eslint-disable react/prop-types */
|
2019-08-26 08:51:36 +00:00
|
|
|
import React from "react";
|
|
|
|
import Scrollbar from "../scrollbar";
|
2019-08-13 12:04:56 +00:00
|
|
|
|
2021-10-20 15:43:48 +00:00
|
|
|
export class CustomScrollbars extends React.Component {
|
2019-08-26 08:51:36 +00:00
|
|
|
refSetter = (scrollbarsRef, forwardedRef) => {
|
|
|
|
if (scrollbarsRef) {
|
|
|
|
forwardedRef(scrollbarsRef.view);
|
|
|
|
} else {
|
|
|
|
forwardedRef(null);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const {
|
|
|
|
onScroll,
|
|
|
|
forwardedRef,
|
|
|
|
style,
|
|
|
|
children,
|
|
|
|
className,
|
2020-10-16 13:16:01 +00:00
|
|
|
stype,
|
2019-08-26 08:51:36 +00:00
|
|
|
} = this.props;
|
|
|
|
//console.log("CustomScrollbars", this.props);
|
2019-08-13 12:04:56 +00:00
|
|
|
return (
|
|
|
|
<Scrollbar
|
2020-10-16 13:16:01 +00:00
|
|
|
ref={(scrollbarsRef) =>
|
2019-08-26 08:51:36 +00:00
|
|
|
this.refSetter.bind(this, scrollbarsRef, forwardedRef)
|
|
|
|
}
|
2019-08-13 12:04:56 +00:00
|
|
|
style={{ ...style, overflow: "hidden" }}
|
|
|
|
onScroll={onScroll}
|
2019-08-26 08:51:36 +00:00
|
|
|
stype={stype}
|
|
|
|
className={className}
|
2019-08-13 12:04:56 +00:00
|
|
|
>
|
|
|
|
{children}
|
2021-10-19 09:18:07 +00:00
|
|
|
<div className="additional-scroll-height"></div>
|
2019-08-13 12:04:56 +00:00
|
|
|
</Scrollbar>
|
|
|
|
);
|
2019-08-26 08:51:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
CustomScrollbars.defaultProps = {
|
2020-10-16 13:16:01 +00:00
|
|
|
stype: "smallBlack",
|
2019-08-26 08:51:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const CustomScrollbarsVirtualList = React.forwardRef((props, ref) => (
|
|
|
|
<CustomScrollbars {...props} forwardedRef={ref} />
|
|
|
|
));
|
2019-08-13 12:04:56 +00:00
|
|
|
|
2019-08-26 08:51:36 +00:00
|
|
|
export default CustomScrollbarsVirtualList;
|