From f79728bf6f05ce68ac061eb4ed9d56205da3c983 Mon Sep 17 00:00:00 2001 From: Adam Shaw Date: Tue, 28 Jul 2020 23:26:13 -0400 Subject: [PATCH] stop using renderVirtual. causes React rendering problems with nested rendering --- packages-premium | 2 +- packages/common/src/main.ts | 3 +-- packages/common/src/util/dom-manip.ts | 10 ---------- packages/common/src/util/table-styling.tsx | 22 +++++++--------------- 4 files changed, 9 insertions(+), 28 deletions(-) diff --git a/packages-premium b/packages-premium index 6ad212400d..0a250709ca 160000 --- a/packages-premium +++ b/packages-premium @@ -1 +1 @@ -Subproject commit 6ad212400d7a48c2dc231259eac50c5a5ab84906 +Subproject commit 0a250709ca48614be68a94a0f586cab4573b4f9a diff --git a/packages/common/src/main.ts b/packages/common/src/main.ts index 1568eaf488..2cff8a04c5 100644 --- a/packages/common/src/main.ts +++ b/packages/common/src/main.ts @@ -69,8 +69,7 @@ export { applyStyle, applyStyleProp, elementMatches, - elementClosest, - renderVirtual + elementClosest } from './util/dom-manip' export { parseClassNames } from './util/html' diff --git a/packages/common/src/util/dom-manip.ts b/packages/common/src/util/dom-manip.ts index dafe72d08b..f627d818db 100644 --- a/packages/common/src/util/dom-manip.ts +++ b/packages/common/src/util/dom-manip.ts @@ -1,5 +1,4 @@ import { Dictionary } from '../options' -import { VNode, render } from '../vdom' export function removeElement(el: HTMLElement) { // removes nodes in addition to elements. bad name @@ -8,15 +7,6 @@ export function removeElement(el: HTMLElement) { // removes nodes in addition to } } -export function renderVirtual(v: VNode): HTMLElement { // TODO: use elsewhere? - let parentEl = document.createElement('div') - render( - v as any, // React only specifically accepts a vdom *element*, which we don't have a type for - parentEl - ) - return parentEl.firstChild as HTMLElement -} - // Querying // ---------------------------------------------------------------------------------------------------------------- diff --git a/packages/common/src/util/table-styling.tsx b/packages/common/src/util/table-styling.tsx index abfced7d87..5a45d83932 100644 --- a/packages/common/src/util/table-styling.tsx +++ b/packages/common/src/util/table-styling.tsx @@ -1,6 +1,3 @@ -import { createElement } from '../vdom' -import { renderVirtual } from './dom-manip' - let canVGrowWithinCell: boolean @@ -14,18 +11,13 @@ export function getCanVGrowWithinCell() { function computeCanVGrowWithinCell() { - // TODO: abstraction for creating these temporary detection-based els - let el = renderVirtual( -
- - - - -
-
-
-
- ) + let el = document.createElement('div') + el.style.position = 'absolute' + el.style.top = '0px' + el.style.left = '0px' + el.innerHTML = '
' + el.querySelector('table').style.height = '100px' + el.querySelector('div').style.height = '100%' document.body.appendChild(el)