mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 00:18:12 +00:00
compose_area: Fix compose_area pasted message bigger than max_length.
Fix a bug where the compose box cut the message without warning the user the message pasted was longer than the allowed. It was fixed by stopping cutting the message off and showing an indicator whenever the limit exceeds and removing the indicator as soon as message gets less than that. The cut off for showing the indicator is set as 90% of the limit. Fixes #15909 Co-authored-by: João Maurício <carvalho.joaomauricio@gmail.com>
This commit is contained in:
@@ -195,6 +195,7 @@ export function create_message_object() {
|
||||
|
||||
export function clear_compose_box() {
|
||||
$("#compose-textarea").val("").trigger("focus");
|
||||
compose_validate.check_and_set_overflow_text();
|
||||
drafts.delete_active_draft();
|
||||
compose_ui.autosize_textarea($("#compose-textarea"));
|
||||
$("#compose-send-status").hide(0);
|
||||
@@ -628,6 +629,10 @@ export function initialize() {
|
||||
handle_keyup(event, $("#compose-textarea").expectOne());
|
||||
});
|
||||
|
||||
$("#compose-textarea").on("input propertychange", () => {
|
||||
compose_validate.check_and_set_overflow_text();
|
||||
});
|
||||
|
||||
$("#compose form").on("submit", (e) => {
|
||||
e.preventDefault();
|
||||
finish();
|
||||
|
||||
Reference in New Issue
Block a user