rsuite-table
Advanced tools
Comparing version 3.5.5 to 3.5.6
@@ -0,1 +1,5 @@ | ||
# 3.5.6 | ||
- Fixed an issue where the scrollbar position was not updated after the data was updated | ||
# 3.5.5 | ||
@@ -2,0 +6,0 @@ |
@@ -7,2 +7,2 @@ "use strict"; | ||
var LAYER_WIDTH = exports.LAYER_WIDTH = 30; | ||
var SCROLLBAR_MIN_WIDTH = exports.SCROLLBAR_MIN_WIDTH = 20; | ||
var SCROLLBAR_MIN_WIDTH = exports.SCROLLBAR_MIN_WIDTH = 14; |
@@ -270,3 +270,3 @@ 'use strict'; | ||
value: function componentDidUpdate(prevProps) { | ||
this.calculateTableContextHeight(); | ||
this.calculateTableContextHeight(prevProps); | ||
this.calculateTableContentWidth(prevProps); | ||
@@ -497,2 +497,3 @@ this.calculateRowMaxHeight(); | ||
} | ||
if (this.tableHeader) { | ||
@@ -606,3 +607,3 @@ (0, _utils.toggleClass)(this.tableHeader, this.addPrefix('cell-group-shadow'), this.scrollY < 0); | ||
key: 'calculateTableContextHeight', | ||
value: function calculateTableContextHeight() { | ||
value: function calculateTableContextHeight(prevProps) { | ||
var table = this.table; | ||
@@ -627,2 +628,8 @@ var rows = table.querySelectorAll('.' + this.addPrefix('row')) || []; | ||
// 如果 data 更新,则更新滚动条位置 | ||
if (prevProps && prevProps.data !== this.props.data) { | ||
var top = Math.abs(this.scrollY) / nextContentHeight * (height - headerHeight); | ||
this.scrollbarY.resetScrollBarPosition(top); | ||
} | ||
if (!autoHeight) { | ||
@@ -629,0 +636,0 @@ // 这里 -10 是为了让滚动条不挡住内容部分 |
{ | ||
"name": "rsuite-table", | ||
"version": "3.5.5", | ||
"version": "3.5.6", | ||
"description": "A React table component", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
export const LAYER_WIDTH = 30; | ||
export const SCROLLBAR_MIN_WIDTH = 20; | ||
export const SCROLLBAR_MIN_WIDTH = 14; |
@@ -301,3 +301,3 @@ // @flow | ||
componentDidUpdate(prevProps: Props) { | ||
this.calculateTableContextHeight(); | ||
this.calculateTableContextHeight(prevProps); | ||
this.calculateTableContentWidth(prevProps); | ||
@@ -659,2 +659,3 @@ this.calculateRowMaxHeight(); | ||
} | ||
if (this.tableHeader) { | ||
@@ -813,3 +814,3 @@ toggleClass(this.tableHeader, this.addPrefix('cell-group-shadow'), this.scrollY < 0); | ||
calculateTableContextHeight() { | ||
calculateTableContextHeight(prevProps: Props) { | ||
const table = this.table; | ||
@@ -830,2 +831,8 @@ const rows = table.querySelectorAll(`.${this.addPrefix('row')}`) || []; | ||
// 如果 data 更新,则更新滚动条位置 | ||
if (prevProps && prevProps.data !== this.props.data) { | ||
const top = (Math.abs(this.scrollY) / nextContentHeight) * (height - headerHeight); | ||
this.scrollbarY.resetScrollBarPosition(top); | ||
} | ||
if (!autoHeight) { | ||
@@ -832,0 +839,0 @@ // 这里 -10 是为了让滚动条不挡住内容部分 |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
4477
211598
58