From fe6dc7812b3ba88d7c3823101a21aa1309102664 Mon Sep 17 00:00:00 2001 From: Meck Date: Thu, 27 Oct 2016 14:03:28 +0800 Subject: [PATCH] Don't need update scrollPostion when scroll vertically. --- src/Table.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Table.jsx b/src/Table.jsx index 934a2cfa5..bf12dedae 100644 --- a/src/Table.jsx +++ b/src/Table.jsx @@ -692,9 +692,11 @@ const Table = React.createClass({ if (e.target !== this.scrollTarget) { return; } + // Remember last scrollLeft for scroll direction detecting. + this.lastScrollLeft = e.target.scrollLeft; const { scroll = {} } = this.props; const { headTable, bodyTable, fixedColumnsBodyLeft, fixedColumnsBodyRight } = this.refs; - if (scroll.x) { + if (scroll.x && e.target.scrollLeft !== this.lastScrollLeft) { if (e.target === bodyTable && headTable) { headTable.scrollLeft = e.target.scrollLeft; } else if (e.target === headTable && bodyTable) {