Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: fix editor zoom on trackpads

Abdullah Atta4308e3bf49d4
diff --git a/apps/web/src/components/editor/tiptap.tsx b/apps/web/src/components/editor/tiptap.tsx
index 6a51cc650..6d9f27b90 100644
--- a/apps/web/src/components/editor/tiptap.tsx
+++ b/apps/web/src/components/editor/tiptap.tsx
@@ -451,7 +451,9 @@ function TiptapWrapper(
if (e.ctrlKey) {
e.preventDefault();
const delta =
- Math.ceil(-e.deltaY / 10 / EDITOR_ZOOM.STEP) * EDITOR_ZOOM.STEP;
+ (e.deltaY > 0 && e.deltaY < 10) || (e.deltaY > -10 && e.deltaY < 0)
+ ? -e.deltaY
+ : Math.ceil(-e.deltaY / 10 / EDITOR_ZOOM.STEP) * EDITOR_ZOOM.STEP;
const zoom = Math.min(
EDITOR_ZOOM.MAX,
Math.max(EDITOR_ZOOM.MIN, editorConfig.zoom + delta)