Adam Shaw 5 лет назад
Родитель
Сommit
755c733d63
1 измененных файлов с 17 добавлено и 19 удалено
  1. 17 19
      packages/daygrid/src/TableRow.tsx

+ 17 - 19
packages/daygrid/src/TableRow.tsx

@@ -318,25 +318,23 @@ export default class TableRow extends DateComponent<TableRowProps, TableRowState
       let cellContentEls = this.cellContentElRefs.collect()
 
       if (cellContentEls.length) {
-        let offsetParent = cellContentEls[0].offsetParent as HTMLElement
-
-        if (offsetParent) { // preact was unmounting the element, but componentDidUpdate was firing after. guard
-          this.setState({ // will trigger isHorizontalChange...
-            cellInnerPositions: new PositionCache(
-              offsetParent,
-              cellInnerEls,
-              true, // isHorizontal
-              false
-            ),
-            cellContentPositions: new PositionCache(
-              offsetParent,
-              cellContentEls,
-              true, // isHorizontal (for computeFgSegPlacement)
-              true // isVertical (for computeMaxContentHeight)
-            ),
-            segHeights: null
-          })
-        }
+        let originEl = this.base as HTMLElement // BAD
+
+        this.setState({ // will trigger isHorizontalChange...
+          cellInnerPositions: new PositionCache(
+            originEl,
+            cellInnerEls,
+            true, // isHorizontal
+            false
+          ),
+          cellContentPositions: new PositionCache(
+            originEl,
+            cellContentEls,
+            true, // isHorizontal (for computeFgSegPlacement)
+            false
+          ),
+          segHeights: null
+        })
       }
 
     } else if (isHorizontalChange) {