Skip to content

Commit

Permalink
[components] Avoid repaint on scroll (#615)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristoffer J. Sivertsen authored Feb 27, 2018
1 parent f520138 commit ca81321
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
}

.scrollContainer {
transform: translateZ(0);
position: absolute;
top: 0;
left: 0;
Expand Down
3 changes: 2 additions & 1 deletion packages/@sanity/components/src/utilities/ScrollContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default class ScrollContainer extends React.PureComponent {
}

static defaultProps = {
className: '',
onScroll: () => {}
}

Expand Down Expand Up @@ -47,7 +48,7 @@ export default class ScrollContainer extends React.PureComponent {
return (
<div
ref={this.setScrollContainerElement}
className={this.props.className || styles.scrollContainer}
className={`${styles.scrollContainer} ${this.props.className}`}
>
{this.props.children}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.scrollContainer {
transform: translateZ(0);
position: absolute;
top: 0;
left: 0;
Expand Down

0 comments on commit ca81321

Please sign in to comment.