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

feat(handsontable): 造价书计量单位列无法拖动宽度问题,环节比对同名的列拖动宽度后handsontable识别错误问题

zhangweicheng 4 лет назад
Родитель
Сommit
72106cd1df

+ 1 - 1
handsontable/package.json

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

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

@@ -143,7 +143,15 @@ class ManualColumnResize extends BasePlugin {
     this.currentTH = TH;
     // getCoords returns CellCoords
     // const col = this.hot.view.wt.wtTable.getCoords(TH).col;
-    const col = this.hot.getColHeader().indexOf(TH.innerText);
+    // const col = this.hot.getColHeader().indexOf(TH.innerText);
+    let col = 0;
+    for (let i = 0; i < TH.parentNode.childNodes.length; i += 1) {
+      if (TH.parentNode.childNodes[i] === TH) col = i;
+    }
+
+    if (!TH.parentNode.childNodes[0].innerText.replace(/(\s| )/gi, '')) {
+      col -= 1;
+    }
 
     const headerHeight = outerHeight(this.currentTH);