compose: Set a min-height before showing preview area.

Changes in #32695 wrongly assumed the preview box can only
expand from the composebox, but for some situations like links
it can also have a preview block that is less high than the raw text.

Reported on CZO:
https://chat.zulip.org/#narrow/channel/9-issues/topic/Preview.20breaks.20when.20the.20compose.20box.20is.20expanded.20by.20itself.2E/near/2029447
This commit is contained in:
evykassirer
2025-01-06 12:06:06 -08:00
committed by Tim Abbott
parent d4a130d88d
commit c4542df0d7
2 changed files with 4 additions and 0 deletions

View File

@@ -71,6 +71,8 @@ export function show_preview_area() {
$("#compose .preview_content"),
content,
);
const edit_height = $compose_textarea.height();
$preview_message_area.css({"min-height": edit_height + "px"});
$preview_message_area.show();
}

View File

@@ -1665,6 +1665,8 @@ export function show_preview_area($element: JQuery): void {
$row.find(".preview_content"),
content,
);
const edit_height = $msg_edit_content.height();
$preview_message_area.css({"min-height": edit_height + "px"});
$preview_message_area.show();
}