From b2a0e0c6f1d0c362b99dbd8d0249cc6f19f6e9b0 Mon Sep 17 00:00:00 2001
From: BoyuZhou <386607913@qq.com>
Date: Wed, 6 Jun 2018 11:57:26 +0800
Subject: [PATCH 1/2] =?UTF-8?q?fix(bee-table):=20table=E8=A7=A3=E5=86=B3?=
=?UTF-8?q?=E6=BB=9A=E5=8A=A8=E9=94=99=E8=A1=8Cbug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
有固定列时,垂直滚动会错行问题
---
.idea/workspace.xml | 433 +++++++++++++++++++++++++++-----------------
build/Table.js | 10 +-
package.json | 2 +-
src/Table.js | 11 +-
4 files changed, 281 insertions(+), 175 deletions(-)
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 9db380a..f64bf3e 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -2,7 +2,7 @@
-
+
@@ -14,83 +14,146 @@
+
-
-
+
+
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
+
+
+
+
+
-
-
+
+
-
-
-
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -140,7 +203,6 @@
-
@@ -159,6 +221,7 @@
+
@@ -174,9 +237,10 @@
-
-
-
+
+
+
+
@@ -196,41 +260,86 @@
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
@@ -278,29 +387,39 @@
-
+
-
-
+
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
@@ -322,9 +441,6 @@
-
-
-
@@ -349,7 +465,14 @@
-
+
+
+
+
+
+
+
+
@@ -408,8 +531,13 @@
-
-
+
+
+
+
+
+
+
@@ -513,8 +641,11 @@
-
-
+
+
+
+
+
@@ -549,8 +680,13 @@
-
-
+
+
+
+
+
+
+
@@ -563,8 +699,11 @@
-
-
+
+
+
+
+
@@ -591,21 +730,19 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -622,8 +759,13 @@
-
-
+
+
+
+
+
+
+
@@ -641,31 +783,11 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
@@ -673,7 +795,6 @@
-
@@ -681,7 +802,6 @@
-
@@ -693,21 +813,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/build/Table.js b/build/Table.js
index 66f5a98..19a021e 100644
--- a/build/Table.js
+++ b/build/Table.js
@@ -804,11 +804,6 @@ var Table = function (_Component) {
};
Table.prototype.handleBodyScroll = function handleBodyScroll(e) {
- // Prevent scrollTop setter trigger onScroll event
- // http://stackoverflow.com/q/1386696
- if (e.target !== this.scrollTarget) {
- return;
- }
var _props$scroll = this.props.scroll,
scroll = _props$scroll === undefined ? {} : _props$scroll;
var _refs = this.refs,
@@ -816,7 +811,12 @@ var Table = function (_Component) {
bodyTable = _refs.bodyTable,
fixedColumnsBodyLeft = _refs.fixedColumnsBodyLeft,
fixedColumnsBodyRight = _refs.fixedColumnsBodyRight;
+ // Prevent scrollTop setter trigger onScroll event
+ // http://stackoverflow.com/q/1386696
+ if (e.target !== this.scrollTarget && this.scrollTarget !== headTable) {
+ return;
+ }
if (scroll.x && e.target.scrollLeft !== this.lastScrollLeft) {
if (e.target === bodyTable && headTable) {
headTable.scrollLeft = e.target.scrollLeft;
diff --git a/package.json b/package.json
index 6888b3a..2c66e3e 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "bee-table",
- "version": "1.2.0",
+ "version": "1.2.1",
"description": "Table ui component for react",
"keywords": [
"react",
diff --git a/src/Table.js b/src/Table.js
index 4df070d..3ad7748 100644
--- a/src/Table.js
+++ b/src/Table.js
@@ -694,13 +694,14 @@ class Table extends Component{
}
handleBodyScroll(e) {
- // Prevent scrollTop setter trigger onScroll event
- // http://stackoverflow.com/q/1386696
- if (e.target !== this.scrollTarget) {
- return;
- }
+
const { scroll = {} } = this.props;
const { headTable, bodyTable, fixedColumnsBodyLeft, fixedColumnsBodyRight } = this.refs;
+ // Prevent scrollTop setter trigger onScroll event
+ // http://stackoverflow.com/q/1386696
+ if (e.target !== this.scrollTarget && this.scrollTarget !== headTable) {
+ return;
+ }
if (scroll.x && e.target.scrollLeft !== this.lastScrollLeft) {
if (e.target === bodyTable && headTable) {
headTable.scrollLeft = e.target.scrollLeft;
From c65735824c88c843ae37fd76c813c03818616fd0 Mon Sep 17 00:00:00 2001
From: BoyuZhou <386607913@qq.com>
Date: Wed, 6 Jun 2018 11:57:30 +0800
Subject: [PATCH 2/2] publish 1.2.1
---
CHANGELOG.md | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 74e936b..8a01978 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,13 @@
+
+## [1.2.1](https://github.com/tinper-bee/bee-table/compare/v1.2.0...v1.2.1) (2018-06-06)
+
+
+### Bug Fixes
+
+* **bee-table:** table解决滚动错行bug ([b2a0e0c](https://github.com/tinper-bee/bee-table/commit/b2a0e0c))
+
+
+
# [1.2.0](https://github.com/tinper-bee/bee-table/compare/v1.1.7...v1.2.0) (2018-05-22)