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"}`); });