Ver código fonte

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

zhangweicheng 4 anos atrás
pai
commit
12a1b9ad36

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

@@ -141,13 +141,9 @@ class ManualColumnResize extends BasePlugin {
     }
 
     this.currentTH = TH;
-
-    // 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;
+    // getCoords returns CellCoords
+    // const col = this.hot.view.wt.wtTable.getCoords(TH).col;
+    const col = this.hot.getColHeader().indexOf(TH.innerText);
 
     const headerHeight = outerHeight(this.currentTH);