mirror of
https://github.com/zulip/zulip.git
synced 2025-11-18 21:48:30 +00:00
drafts: getSelection to differentiate clicks from drags.
We can use getSelection to distinguish between clicks and drags while accessing the body of a saved draft. Previously, the draft would be restored when trying to select draft text to copy/paste. Fixes #14447.
This commit is contained in:
@@ -334,6 +334,10 @@ exports.launch = function () {
|
||||
|
||||
function setup_event_handlers() {
|
||||
$(".restore-draft").on("click", function (e) {
|
||||
if (document.getSelection().type === "Range") {
|
||||
return;
|
||||
}
|
||||
|
||||
e.stopPropagation();
|
||||
|
||||
const draft_row = $(this).closest(".draft-row");
|
||||
|
||||
Reference in New Issue
Block a user