Skip to content

Commit 473a1df

Browse files
committed
fix scrolling with trackpad
1 parent beb3add commit 473a1df

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/lib/scroll/ScrollElement.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ class ScrollElement extends Component {
2222
}
2323
}
2424

25-
25+
/**
26+
* needed to handle scrolling with trackpad
27+
*/
28+
handleScroll = () => {
29+
const scrollX = this.scrollComponent.scrollLeft
30+
this.props.onScroll(scrollX)
31+
}
2632

2733
refHandler = el => {
2834
this.scrollComponent = el
@@ -192,6 +198,7 @@ class ScrollElement extends Component {
192198
onTouchStart={this.handleTouchStart}
193199
onTouchMove={this.handleTouchMove}
194200
onTouchEnd={this.handleTouchEnd}
201+
onScroll={this.handleScroll}
195202
>
196203
{children}
197204
</div>

0 commit comments

Comments
 (0)