diff --git a/beta/src/components/MDX/Sandpack/CustomPreset.tsx b/beta/src/components/MDX/Sandpack/CustomPreset.tsx index a3ea1fe0..eae75221 100644 --- a/beta/src/components/MDX/Sandpack/CustomPreset.tsx +++ b/beta/src/components/MDX/Sandpack/CustomPreset.tsx @@ -44,13 +44,6 @@ export function CustomPreset({ } const lineCount = lineCountRef.current[activePath]; const isExpandable = lineCount > 16 || isExpanded; - const editorHeight = isExpandable ? lineCount * 24 + 24 : 'auto'; // shown lines * line height (24px) - const getHeight = () => { - if (!isExpandable) { - return editorHeight; - } - return isExpanded ? editorHeight : 406; - }; return ( <> @@ -63,31 +56,19 @@ export function CustomPreset({ ref={sandpack.lazyAnchorRef} className={cn( 'sp-layout sp-custom-layout', - showDevTools && devToolsLoaded && 'sp-layout-devtools' - )} - style={{ - // Prevent it from collapsing below the initial (non-loaded) height. - // There has to be some better way to do this... - minHeight: 216, - }}> + showDevTools && devToolsLoaded && 'sp-layout-devtools', + isExpanded && 'sp-layout-expanded' + )}> - {isExpandable && (