Skip to content

Commit

Permalink
fix: 控制面板无法复制
Browse files Browse the repository at this point in the history
  • Loading branch information
CodFrm committed Oct 22, 2021
1 parent a58d71c commit bcb3960
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/apps/grant/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -992,9 +992,13 @@ export class BackgroundGrant {
listener: () => {
document.body.appendChild(BackgroundGrant.textarea);
document.addEventListener('copy', (e: ClipboardEvent) => {
if (!BackgroundGrant.clipboardData) {
return;
}
e.preventDefault();
let { type, data } = BackgroundGrant.clipboardData;
(<any>e).clipboardData.setData(type || 'text/plain', data);
BackgroundGrant.clipboardData = undefined;
})
}
})
Expand Down

0 comments on commit bcb3960

Please sign in to comment.