Skip to content

Commit

Permalink
fix(open-amdocs#17): Upgraded to React 17, including fix to Scrollable
Browse files Browse the repository at this point in the history
  • Loading branch information
gaeaehrlich committed May 2, 2021
1 parent 37180ad commit cde6c9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
"nyc": "15.1.0",
"postcss": "8.2.1",
"prop-types": "15.7.2",
"react": "16.14.0",
"react-dom": "16.14.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"rollup": "2.35.0",
"rollup-plugin-postcss": "4.0.0",
"rollup-plugin-terser": "7.0.2",
Expand Down
3 changes: 2 additions & 1 deletion src/components/Scrollable/Scrollable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export default class Scrollable extends React.PureComponent {
return {
className: classNames('scrollbar-inner', element.props.className),
ref: copyComponentRef(element.ref, this.container),
onScroll: this.handleOnScroll,
}
};

Expand All @@ -115,7 +116,7 @@ export default class Scrollable extends React.PureComponent {
const content = React.Children.toArray(children).filter(child => ![VerticalScrollbarPlaceholder, HorizontalScrollbarPlaceholder].includes(child.type));
return (
<ResizeObserver onResize={this.updateScrollbars}>
<div className='scrollbar' style={style} onScroll={this.handleOnScroll}>
<div className='scrollbar' style={style}>
{React.cloneElement(element, this.getElementProps(), content)}
{React.cloneElement(vsb ? vsb.props.children : <VerticalScrollbar/>, {ref: this.vertical, container: this.container})}
{React.cloneElement(hsb ? hsb.props.children : <HorizontalScrollbar/>, {ref: this.horizontal, container: this.container})}
Expand Down

0 comments on commit cde6c9b

Please sign in to comment.