rsuite-table
Advanced tools
Comparing version 3.9.3 to 3.9.4
@@ -0,1 +1,5 @@ | ||
# 3.9.4 | ||
- **Bugfix**: Fixed the problem that the scroll bar is not reset when the data is updated. | ||
# 3.9.3 | ||
@@ -2,0 +6,0 @@ |
@@ -498,2 +498,5 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; | ||
var _cacheChildrenSize = flatten(nextProps.children || []).length; | ||
/** | ||
* 单元格列的信息在初始化后会被缓存,在某些属性被更新以后,需要清除缓存。 | ||
*/ | ||
@@ -503,6 +506,14 @@ if (_cacheChildrenSize !== this._cacheChildrenSize) { | ||
this._cacheCells = null; | ||
} else if (this.props.children !== nextProps.children || this.props.sortColumn !== nextProps.sortColumn || this.props.sortType !== nextProps.sortType) { | ||
this._cacheCells = null; | ||
} | ||
/** | ||
* 逻辑1:当列表中的数据超过一屏,同时滚动条的位置不在第一屏,这个时候如果数据 data 会导致滚动条的位置错误。 | ||
* 处理的方式就是重置 scrollY 值为 0 (这种应用场景通常在,表格数据作为文件夹目录一样可以使用,可以点进去) | ||
* 逻辑2:如果当前表格是一个 TreeTable 或者可以展开子面板,即使 data 有更新,都保留当前滚动条位置,不重置。 | ||
*/ | ||
if (this.props.children !== nextProps.children || this.props.sortColumn !== nextProps.sortColumn || this.props.sortType !== nextProps.sortType) { | ||
this._cacheCells = null; | ||
if (nextProps.data !== this.props.data && !nextProps.isTree && typeof nextProps.renderRowExpanded === 'undefined') { | ||
this.scrollY = 0; | ||
} | ||
@@ -509,0 +520,0 @@ |
@@ -529,2 +529,5 @@ "use strict"; | ||
var _cacheChildrenSize = (0, _flatten["default"])(nextProps.children || []).length; | ||
/** | ||
* 单元格列的信息在初始化后会被缓存,在某些属性被更新以后,需要清除缓存。 | ||
*/ | ||
@@ -534,6 +537,14 @@ if (_cacheChildrenSize !== this._cacheChildrenSize) { | ||
this._cacheCells = null; | ||
} else if (this.props.children !== nextProps.children || this.props.sortColumn !== nextProps.sortColumn || this.props.sortType !== nextProps.sortType) { | ||
this._cacheCells = null; | ||
} | ||
/** | ||
* 逻辑1:当列表中的数据超过一屏,同时滚动条的位置不在第一屏,这个时候如果数据 data 会导致滚动条的位置错误。 | ||
* 处理的方式就是重置 scrollY 值为 0 (这种应用场景通常在,表格数据作为文件夹目录一样可以使用,可以点进去) | ||
* 逻辑2:如果当前表格是一个 TreeTable 或者可以展开子面板,即使 data 有更新,都保留当前滚动条位置,不重置。 | ||
*/ | ||
if (this.props.children !== nextProps.children || this.props.sortColumn !== nextProps.sortColumn || this.props.sortType !== nextProps.sortType) { | ||
this._cacheCells = null; | ||
if (nextProps.data !== this.props.data && !nextProps.isTree && typeof nextProps.renderRowExpanded === 'undefined') { | ||
this.scrollY = 0; | ||
} | ||
@@ -540,0 +551,0 @@ |
{ | ||
"name": "rsuite-table", | ||
"version": "3.9.3", | ||
"version": "3.9.4", | ||
"description": "A React table component", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
373030
8019