compose_actions: Fix automated scroll when resizing compose.

This code has been inoperative since 86073588be
upgraded the autosize library without migrating this event.
This commit is contained in:
Evy Kassirer
2024-04-04 16:33:05 -07:00
committed by GitHub
parent 0bae651e23
commit 466560faa1

View File

@@ -93,13 +93,16 @@ function clear_box() {
$(".compose_control_button_container:has(.add-poll)").removeClass("disabled-on-hover");
}
let autosize_callback_opts;
export function autosize_message_content(opts) {
if (!compose_ui.is_full_size()) {
autosize($("textarea#compose-textarea"), {
callback() {
maybe_scroll_up_selected_message(opts);
},
});
autosize_callback_opts = opts;
$("textarea#compose-textarea")
.off("autosize:resized")
.one("autosize:resized", () => {
maybe_scroll_up_selected_message(autosize_callback_opts);
});
autosize($("textarea#compose-textarea"));
}
}