Prefer files when handling paste event
Co-authored-by: trevor-signal <131492920+trevor-signal@users.noreply.github.com>
This commit is contained in:
parent
235b3b7edc
commit
637b0ab346
1 changed files with 6 additions and 3 deletions
|
@ -56,11 +56,14 @@ export class SignalClipboard {
|
||||||
const signal = event.clipboardData.getData('text/signal');
|
const signal = event.clipboardData.getData('text/signal');
|
||||||
|
|
||||||
const clipboardContainsFiles = event.clipboardData.files?.length > 0;
|
const clipboardContainsFiles = event.clipboardData.files?.length > 0;
|
||||||
if (!clipboardContainsFiles) {
|
|
||||||
event.preventDefault();
|
if (clipboardContainsFiles) {
|
||||||
event.stopPropagation();
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
|
||||||
if (selection == null) {
|
if (selection == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue