Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

copy_and_paste: Fix bugs surfaced by typescript migration.

N-Shar-maa567fb633aa9
diff --git a/web/src/copy_and_paste.ts b/web/src/copy_and_paste.ts
index e9d90777c60..47579765783 100644
--- a/web/src/copy_and_paste.ts
+++ b/web/src/copy_and_paste.ts
@@ -292,7 +292,7 @@ function get_end_tr_from_endc($endc: JQuery<Node>): JQuery {
// This handles the issue that Chrome seems to like selecting
// the compose_close button when you go off the end of the
// last message
- return $(".message_row").last();
+ return rows.last_visible();
}
// Sometimes (especially when three click selecting in Chrome) the selection
@@ -313,7 +313,7 @@ function get_end_tr_from_endc($endc: JQuery<Node>): JQuery {
// we can use the last message from the previous recipient_row.
if ($endc.parents(".message_header").length > 0) {
const $overflow_recipient_row = $endc.parents(".recipient_row").first();
- return $overflow_recipient_row.prev(".recipient_row").last();
+ return $overflow_recipient_row.prev(".recipient_row").children(".message_row").last();
}
// If somehow we get here, do the default return.
}