fix: 最后一列拖拽,宽度计算错误
This commit is contained in:
parent
9d17709e30
commit
2fd0aec4db
|
@ -550,7 +550,7 @@ var _initialiseProps = function _initialiseProps() {
|
|||
var type = currentElement.getAttribute('data-type');
|
||||
if (!_this7.props.dragborder && !_this7.props.draggable) return;
|
||||
if (type == 'online' && _this7.props.dragborder) {
|
||||
if (!_this7.props.dragborder) return;
|
||||
// if(!this.props.dragborder)return;
|
||||
targetEvent.setAttribute('draggable', false); //添加交换列效果
|
||||
var currentIndex = -1;
|
||||
var defaultWidth = currentElement.getAttribute("data-th-width");
|
||||
|
@ -573,9 +573,9 @@ var _initialiseProps = function _initialiseProps() {
|
|||
if (!_this7.tableOldWidth) {
|
||||
_this7.tableOldWidth = _this7.drag.tableWidth; //this.getTableWidth();
|
||||
}
|
||||
if (!_this7.lastColumWidth) {
|
||||
// if(!this.lastColumWidth){
|
||||
_this7.lastColumWidth = parseInt(_this7.table.cols[lastShowIndex].style.width);
|
||||
}
|
||||
// }
|
||||
} else if (type != 'online' && _this7.props.draggable) {
|
||||
// if (!this.props.draggable || targetEvent.nodeName.toUpperCase() != "TH") return;
|
||||
if (!_this7.props.draggable) return;
|
||||
|
@ -670,6 +670,7 @@ var _initialiseProps = function _initialiseProps() {
|
|||
_this7.optTableMargin(_this7.table.fixedRighHeadertTable, 0);
|
||||
}
|
||||
} else {
|
||||
l;
|
||||
if (showScroll < 0) {
|
||||
_this7.table.tableBody.style.overflowX = 'auto';
|
||||
_this7.optTableMargin(_this7.table.fixedLeftBodyTable, '-' + scrollbarWidth);
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "bee-table",
|
||||
"version": "2.2.30-nc.12",
|
||||
"version": "2.2.30-nc.13",
|
||||
"description": "Table ui component for react",
|
||||
"keywords": [
|
||||
"react",
|
||||
|
|
|
@ -223,7 +223,7 @@ class TableHeader extends Component {
|
|||
let type = currentElement.getAttribute('data-type');
|
||||
if(!this.props.dragborder && !this.props.draggable)return;
|
||||
if(type == 'online' && this.props.dragborder){
|
||||
if(!this.props.dragborder)return;
|
||||
// if(!this.props.dragborder)return;
|
||||
targetEvent.setAttribute('draggable',false);//添加交换列效果
|
||||
let currentIndex = -1;
|
||||
let defaultWidth = currentElement.getAttribute("data-th-width");
|
||||
|
@ -244,9 +244,9 @@ class TableHeader extends Component {
|
|||
if(!this.tableOldWidth){
|
||||
this.tableOldWidth = this.drag.tableWidth;//this.getTableWidth();
|
||||
}
|
||||
if(!this.lastColumWidth){
|
||||
// if(!this.lastColumWidth){
|
||||
this.lastColumWidth = parseInt(this.table.cols[lastShowIndex].style.width);
|
||||
}
|
||||
// }
|
||||
}else if(type != 'online' && this.props.draggable){
|
||||
// if (!this.props.draggable || targetEvent.nodeName.toUpperCase() != "TH") return;
|
||||
if (!this.props.draggable) return;
|
||||
|
@ -337,7 +337,7 @@ class TableHeader extends Component {
|
|||
this.optTableMargin( this.table.fixedLeftHeaderTable,0);
|
||||
this.optTableMargin( this.table.fixedRighHeadertTable,0);
|
||||
}
|
||||
}else{
|
||||
}else{l
|
||||
if(showScroll < 0){
|
||||
this.table.tableBody.style.overflowX = 'auto';
|
||||
this.optTableMargin( this.table.fixedLeftBodyTable,'-'+scrollbarWidth);
|
||||
|
|
Loading…
Reference in New Issue