From de6115248a6339840be832282107d4936f4e8960 Mon Sep 17 00:00:00 2001 From: Seth Trowbridge Date: Sat, 20 May 2023 08:15:09 -0400 Subject: [PATCH] clear width/hieght on done --- example/tree-menu.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/example/tree-menu.tsx b/example/tree-menu.tsx index d626f8f..8d15542 100644 --- a/example/tree-menu.tsx +++ b/example/tree-menu.tsx @@ -17,7 +17,7 @@ export const Menu =(props:{children:React.JSX.Element|React.JSX.Element[]})=> const [stateGet, stateSet] = React.useContext(CTX); const refElement:React.MutableRefObject = React.useRef( null ); const refControl:React.MutableRefObject = React.useRef( null ); - + const classDefault = "relative transition-all duration-700 border"; const classOpen = "h-auto w-auto top-10 px-4 "; const classShut = "h-0 w-[300px] top-0 px-0"; @@ -57,7 +57,8 @@ export function Collapser(inElement:HTMLElement, initialState = false) inEvent.stopPropagation(); if (userMode) { - inElement.style.height = "auto"; + inElement.style.height = ""; + inElement.style.width = ""; inElement.style.overflow = "visible"; } userDone(userMode);