Просмотр исходного кода

fix(handsontable): 多个项目tab时,表格拖动列偏移问题

zhangweicheng 4 лет назад
Родитель
Сommit
240c3d35cd

+ 1 - 1
handsontable/package.json

@@ -10,7 +10,7 @@
     "url": "https://github.com/handsontable/handsontable/issues"
   },
   "author": "Handsoncode <hello@handsontable.com>",
-  "version": "6.3.8",
+  "version": "6.3.10",
   "browser": "dist/handsontable.js",
   "main": "commonjs/index.js",
   "module": "es/index.js",

+ 7 - 1
handsontable/src/plugins/manualColumnResize/manualColumnResize.js

@@ -142,7 +142,13 @@ class ManualColumnResize extends BasePlugin {
 
     this.currentTH = TH;
 
-    const col = this.hot.view.wt.wtTable.getCoords(TH).col; // getCoords returns CellCoords
+    // const col = this.hot.view.wt.wtTable.getCoords(TH).col; // getCoords returns CellCoords
+    let col = 0;
+    TH.parentNode.children.forEach((element, index) => {
+      if (element === TH) col = index;
+    });
+    if (col > 0) col += -1;
+
     const headerHeight = outerHeight(this.currentTH);
 
     if (col >= 0) { // if not col header