fix(编辑能力): 修复全选及全局快捷键

This commit is contained in:
xiaoqidun committed 2026-10-29 16:09:14 +08:00
1 parent 838a769c5b
commit af80fcc9ba
2 files changed
+18 -5

No files matched your search

+10 -1
View File
@@ -1122,6 +1122,14 @@ export class CanvasEditor {
return true;
}
selectAll(index) {
if (!this.enabled || this.input || this.crop || this.drag || this.nudge || this.nudgeCommit || this.options.busy()) return;
this.setTool("");
document.getSelection()?.removeAllRanges();
this.setSelection(this.pageItems(index));
this.focus();
}
clear() {
this.closeText();
this.closeCrop();
@@ -1952,7 +1960,8 @@ export class CanvasEditor {
}
});
input.addEventListener("keydown", (event) => {
if ((event.ctrlKey || event.metaKey) && !event.altKey && ["s", "w", "tab"].includes(event.key.toLowerCase())) return;
if ((event.ctrlKey || event.metaKey) && !event.altKey && (["s", "w", "tab"].includes(event.key.toLowerCase())
|| !event.shiftKey && ["f", "o", "p"].includes(event.key.toLowerCase()))) return;
event.stopPropagation();
if (event.isComposing || editing.composing || editing.saving) {
return;