From e37c1ae568f8879ce2b2d160157056a3d862b11a Mon Sep 17 00:00:00 2001 From: Seth Trowbridge Date: Tue, 23 May 2023 21:22:13 -0400 Subject: [PATCH] overflow FIRST --- example/tree-menu.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/example/tree-menu.tsx b/example/tree-menu.tsx index 8709074..61e1a12 100644 --- a/example/tree-menu.tsx +++ b/example/tree-menu.tsx @@ -86,6 +86,7 @@ export function Collapser(inElement:HTMLElement, initialState = false) inElement.setAttribute("style", ""); } inTransition = false; + console.log("done", userMode); userDone(userMode); } @@ -129,17 +130,20 @@ export function Collapser(inElement:HTMLElement, initialState = false) console.log(measurements); } + inElement.style.overflow = "hidden"; inElement.style.width = inElement.offsetWidth + "px"; inElement.style.height = inElement.offsetHeight + "px"; - inElement.style.overflow = "hidden"; + inTransition = true; + console.log("from", inElement.offsetWidth, inElement.offsetHeight ); frameRequest = requestAnimationFrame(()=> { const measure = inOpen ? measurements.Open : measurements.Shut; inElement.style.width = measure.width + "px"; inElement.style.height = measure.height + "px"; + console.log(" to", measure.width, measure.height ); inElement.className = inElement.getAttribute("data-class-keep") + " " + inElement.getAttribute(`data-class-${inOpen?"open":"shut"}`); });