|
@@ -905,12 +905,18 @@ async function fetchConnectedTable() {
|
|
|
|
|
|
connectedTable.value = table;
|
|
|
}
|
|
|
+function undoRedoCommand(type, { target }) {
|
|
|
+ const els = ['INPUT', 'SELECT', 'TEXTAREA'];
|
|
|
+ if (els.includes(target.tagName) || target.isContentEditable) return;
|
|
|
+
|
|
|
+ executeCommand(type);
|
|
|
+}
|
|
|
|
|
|
const shortcut = useShortcut([
|
|
|
getShortcut('editor:toggle-sidebar', toggleSidebar),
|
|
|
getShortcut('editor:duplicate-block', duplicateElements),
|
|
|
- getShortcut('action:undo', () => executeCommand('undo')),
|
|
|
- getShortcut('action:redo', () => executeCommand('redo')),
|
|
|
+ getShortcut('action:undo', (_, event) => undoRedoCommand('undo', event)),
|
|
|
+ getShortcut('action:redo', (_, event) => undoRedoCommand('redo', event)),
|
|
|
]);
|
|
|
|
|
|
watch(
|