compose: Avoid preview message area overlap with last message.

Instead of blindly adjusting `compose-textarea` on resize,
we adjust the height of `compose-textarea` or `preview_message_area`
based on which is visible.
This commit is contained in:
Aman Agrawal
2022-01-31 10:27:54 +00:00
committed by Tim Abbott
parent 17f74a3f57
commit 31dd1d554c
3 changed files with 18 additions and 6 deletions

View File

@@ -749,6 +749,11 @@ test_ui("on_events", ({override, override_rewire}) => {
})();
(function test_markdown_preview_compose_clicked() {
let reset_compose_textarea_max_height_called = false;
override(resize, "reset_compose_textarea_max_height", () => {
reset_compose_textarea_max_height_called = true;
});
// Tests setup
function setup_visibilities() {
$("#compose-textarea").show();
@@ -834,6 +839,7 @@ test_ui("on_events", ({override, override_rewire}) => {
assert.equal($("#compose .preview_content").html(), "translated HTML: Nothing to preview");
assert_visibilities();
assert.ok(reset_compose_textarea_max_height_called);
let make_indicator_called = false;
$("#compose-textarea").val("```foobarfoobar```");