mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2026-04-18 07:12:15 +00:00
revert div to input conversion to be able to insert linebreaks to messages
This commit is contained in:
@@ -915,8 +915,9 @@ class SendTextDialog extends Dialog {
|
||||
if (e.code === "Escape") {
|
||||
this.hide();
|
||||
}
|
||||
if (e.code === "Enter" && (!e.ctrlKey && !e.metaKey)) {
|
||||
e.preventDefault();
|
||||
if (e.code === "Enter" && (e.ctrlKey || e.metaKey)) {
|
||||
this._send();
|
||||
this.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -930,7 +931,9 @@ class SendTextDialog extends Dialog {
|
||||
const sel = window.getSelection();
|
||||
|
||||
this.$text.focus();
|
||||
this.$text.select();
|
||||
range.selectNodeContents(this.$text);
|
||||
sel.removeAllRanges();
|
||||
sel.addRange(range);
|
||||
}
|
||||
|
||||
_handleShareTargetText() {
|
||||
@@ -942,7 +945,7 @@ class SendTextDialog extends Dialog {
|
||||
_send() {
|
||||
Events.fire('send-text', {
|
||||
to: this._recipient,
|
||||
text: this.$text.value
|
||||
text: this.$text.innerText
|
||||
});
|
||||
this.$text.value = "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user