From 7c312ff5f1a6297b7fc56c776e4f5349b82812fa Mon Sep 17 00:00:00 2001 From: domind Date: Tue, 4 Feb 2020 11:06:07 +0200 Subject: [PATCH] fix for #1164 --- src/components/TableResize.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/components/TableResize.js b/src/components/TableResize.js index 97c74023e..a244571df 100644 --- a/src/components/TableResize.js +++ b/src/components/TableResize.js @@ -58,7 +58,7 @@ class TableResize extends React.Component { setDividers = () => { const tableEl = findDOMNode(this.tableRef); const { width: tableWidth, height: tableHeight } = tableEl.getBoundingClientRect(); - const { priorPosition, resizeCoords } = this.state; + const { resizeCoords } = this.state; let finalCells = Object.entries(this.cellsRef); @@ -67,17 +67,10 @@ class TableResize extends React.Component { const elRect = item.getBoundingClientRect(); const elStyle = window.getComputedStyle(item, null); - const left = resizeCoords[key] !== undefined ? resizeCoords[key].left : undefined; - const oldLeft = priorPosition[key] || 0; - let newLeft = elRect.left + item.offsetWidth - parseInt(elStyle.paddingLeft) / 2; - - if (left === oldLeft) return; - - resizeCoords[key] = { left: newLeft }; - priorPosition[key] = newLeft; + resizeCoords[key] = { left: elRect.left + item.offsetWidth - parseInt(elStyle.paddingLeft) / 2 }; }); - this.setState({ tableWidth, tableHeight, resizeCoords, priorPosition }, this.updateWidths); + this.setState({ tableWidth, tableHeight, resizeCoords }, this.updateWidths); }; updateWidths = () => {