Skip to content

Commit c967da4

Browse files
committed
fix(web): a terminal drag that saves nothing restores the rendered height
1 parent 60ef839 commit c967da4

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎apps/web/src/components/ThreadTerminalDrawer.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,6 +1460,11 @@ export default function ThreadTerminalDrawer({
14601460
// A drag that ends where it started keeps the stored preference, which may
14611461
// be taller than the window-capped height the drag started from.
14621462
if (!didResizeDuringDragRef.current || drawerHeightRef.current === resizeState.startHeight) {
1463+
// React skips the write when the rendered height did not change, so put
1464+
// back the preference as the current window caps it.
1465+
const renderedHeight = clampDrawerHeight(preferredDrawerHeightRef.current);
1466+
drawerHeightRef.current = renderedHeight;
1467+
resizeState.drawer?.style.setProperty("height", `${renderedHeight}px`);
14631468
return;
14641469
}
14651470
setDrawerHeight(drawerHeightRef.current);

0 commit comments

Comments
 (0)