Only work on linux
This commit is contained in:
parent
47ecf6ab86
commit
4b89022d0c
1 changed files with 13 additions and 11 deletions
|
@ -102,17 +102,19 @@ export class Wnd {
|
|||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
// 阻止 Linux 中键粘贴
|
||||
const activeElement = document.activeElement;
|
||||
window.addEventListener("paste", (e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}, {
|
||||
capture: true,
|
||||
once: true
|
||||
});
|
||||
// 保持原有焦点
|
||||
if (activeElement instanceof HTMLElement) {
|
||||
activeElement.focus();
|
||||
if ("linux" === window.siyuan.config.system.os) {
|
||||
const activeElement = document.activeElement;
|
||||
window.addEventListener("paste", (e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}, {
|
||||
capture: true,
|
||||
once: true
|
||||
});
|
||||
// 保持原有焦点
|
||||
if (activeElement instanceof HTMLElement) {
|
||||
activeElement.focus();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue