fix(编辑能力): 修复工具栏撤销快捷键失效
build.yaml / build (push) Successful in 48s

This commit is contained in:
xiaoqidun committed 2026-10-29 14:16:31 +08:00
1 parent 9c3a04b7eb
commit 80e548f93e
1 file changed
+3 -1
+3 -1
View File
@@ -1995,7 +1995,9 @@ function handleKeyDown(event) {
}
}
if (event.ctrlKey || event.metaKey) {
if (state.editing && !target.closest("input, textarea, select, [contenteditable]")
const field = target.closest("input, textarea, select, [contenteditable]");
const editorControl = field && el.editorTools.contains(field) && field.matches('select, input[type="checkbox"], input[type="radio"], input[type="color"], input[type="range"]');
if (state.editing && (!field || editorControl)
&& (key.toLowerCase() === "z" || (!event.shiftKey && key.toLowerCase() === "y"))) {
event.preventDefault();
(key.toLowerCase() === "y" || event.shiftKey ? el.redoButton : el.undoButton).click();