fix(scroll为y时宽度计算问题bug):
This commit is contained in:
parent
2ecdcf74e4
commit
c5789893cf
|
@ -211,6 +211,10 @@ var Table = function (_Component) {
|
||||||
|
|
||||||
Table.prototype.componentDidMount = function componentDidMount() {
|
Table.prototype.componentDidMount = function componentDidMount() {
|
||||||
setTimeout(this.resetScrollY, 300);
|
setTimeout(this.resetScrollY, 300);
|
||||||
|
//含有纵向滚动条
|
||||||
|
if (this.props.scroll.y) {
|
||||||
|
this.scrollbarWidth = (0, _utils.measureScrollbar)();
|
||||||
|
}
|
||||||
//后续也放在recevice里面
|
//后续也放在recevice里面
|
||||||
if (!this.props.originWidth) {
|
if (!this.props.originWidth) {
|
||||||
this.computeTableWidth();
|
this.computeTableWidth();
|
||||||
|
@ -290,7 +294,7 @@ var Table = function (_Component) {
|
||||||
var lastShowIndex = computeObj.lastShowIndex;
|
var lastShowIndex = computeObj.lastShowIndex;
|
||||||
this.computeWidth = computeObj.computeWidth;
|
this.computeWidth = computeObj.computeWidth;
|
||||||
if (this.computeWidth < this.contentWidth) {
|
if (this.computeWidth < this.contentWidth) {
|
||||||
var contentWidthDiff = this.contentWidth - this.computeWidth;
|
var contentWidthDiff = this.scrollbarWidth ? this.contentWidth - this.computeWidth - this.scrollbarWidth : this.contentWidth - this.computeWidth;
|
||||||
this.setState({ contentWidthDiff: contentWidthDiff, lastShowIndex: lastShowIndex });
|
this.setState({ contentWidthDiff: contentWidthDiff, lastShowIndex: lastShowIndex });
|
||||||
} else {
|
} else {
|
||||||
this.contentWidth = this.computeWidth;
|
this.contentWidth = this.computeWidth;
|
||||||
|
@ -740,7 +744,7 @@ var Table = function (_Component) {
|
||||||
useFixedHeader = true;
|
useFixedHeader = true;
|
||||||
|
|
||||||
// Add negative margin bottom for scroll bar overflow bug
|
// Add negative margin bottom for scroll bar overflow bug
|
||||||
var scrollbarWidth = (0, _utils.measureScrollbar)();
|
var scrollbarWidth = this.scrollbarWidth;
|
||||||
if (scrollbarWidth >= 0) {
|
if (scrollbarWidth >= 0) {
|
||||||
(fixed ? bodyStyle : headStyle).paddingBottom = '0px';
|
(fixed ? bodyStyle : headStyle).paddingBottom = '0px';
|
||||||
//显示表头滚动条
|
//显示表头滚动条
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "bee-table",
|
"name": "bee-table",
|
||||||
"version": "1.4.35",
|
"version": "1.4.36",
|
||||||
"description": "Table ui component for react",
|
"description": "Table ui component for react",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react",
|
"react",
|
||||||
|
|
Loading…
Reference in New Issue