mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2026-04-06 01:43:48 +00:00
Prevent executing _onCopy() when text is selected on receive text dialog
This commit is contained in:
@@ -1978,12 +1978,15 @@ class ReceiveTextDialog extends Dialog {
|
||||
this._receiveTextQueue = [];
|
||||
}
|
||||
|
||||
selectionEmpty() {
|
||||
return !window.getSelection().toString()
|
||||
}
|
||||
|
||||
async _onKeyDown(e) {
|
||||
if (!this.isShown()) return
|
||||
|
||||
if (e.code === "KeyC" && (e.ctrlKey || e.metaKey)) {
|
||||
if (e.code === "KeyC" && (e.ctrlKey || e.metaKey) && this.selectionEmpty()) {
|
||||
await this._onCopy()
|
||||
this.hide();
|
||||
}
|
||||
else if (e.code === "Escape") {
|
||||
this.hide();
|
||||
|
||||
Reference in New Issue
Block a user