Skip to content

Commit 8e5361b

Browse files
committed
FIX: Remove keyboard shortcuts for undo/redo
1 parent 719882e commit 8e5361b

2 files changed

Lines changed: 2 additions & 27 deletions

File tree

packages/frontend/src/page/document_page.tsx

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Resizable, { type ContextValue } from "@corvu/resizable";
2-
import { makeEventListener } from "@solid-primitives/event-listener";
32
import { Title } from "@solidjs/meta";
43
import { useNavigate, useParams } from "@solidjs/router";
54
import ChevronsRight from "lucide-solid/icons/chevrons-right";
@@ -406,27 +405,6 @@ export function DocumentPane(props: {
406405

407406
const history = useSnapshotHistory(() => props.docRef.refId);
408407

409-
makeEventListener(window, "keydown", (evt) => {
410-
const mod = evt.metaKey || evt.ctrlKey;
411-
if (!mod || evt.altKey) {
412-
return;
413-
}
414-
415-
if (evt.key === "z" || evt.key === "Z") {
416-
if (evt.shiftKey) {
417-
if (history.canRedo()) {
418-
evt.preventDefault();
419-
history.onRedo();
420-
}
421-
} else {
422-
if (history.canUndo()) {
423-
evt.preventDefault();
424-
history.onUndo();
425-
}
426-
}
427-
}
428-
});
429-
430408
return (
431409
<div class="document-pane-layout">
432410
<div class="document-pane-content">
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { HistoryNavigator } from "catcolab-ui-components";
22
import { type SnapshotHistory, useSnapshotHistory } from "./use_snapshot_history";
33

4-
const isMac = typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.userAgent);
5-
const mod = isMac ? "\u2318" : "Ctrl";
6-
74
export function HistorySidebar(props: { refId: string; history?: SnapshotHistory }) {
85
const ownHistory = useSnapshotHistory(() => props.refId);
96
const history = () => props.history ?? ownHistory;
@@ -16,8 +13,8 @@ export function HistorySidebar(props: { refId: string; history?: SnapshotHistory
1613
onUndo={history().onUndo}
1714
onRedo={history().onRedo}
1815
onSelect={history().navigate}
19-
undoTooltip={`Undo (${mod}+Z)`}
20-
redoTooltip={`Redo (${mod}+Shift+Z)`}
16+
undoTooltip="Undo"
17+
redoTooltip="Redo"
2118
/>
2219
);
2320
}

0 commit comments

Comments
 (0)