diff --git a/apps/client/src/widgets/type_widgets/code/Code.tsx b/apps/client/src/widgets/type_widgets/code/Code.tsx index b3c8686fae..3c12a8036b 100644 --- a/apps/client/src/widgets/type_widgets/code/Code.tsx +++ b/apps/client/src/widgets/type_widgets/code/Code.tsx @@ -180,7 +180,8 @@ export function CodeEditor({ parentComponent, ntxId, containerRef: externalConta resolve(refToJQuerySelector(containerRef)); }); - useTriliumEvent("scrollToEnd", () => { + useTriliumEvent("scrollToEnd", ({ ntxId: eventNtxId }) => { + if (eventNtxId !== ntxId) return; const editor = codeEditorRef.current; if (!editor) return; editor.scrollToEnd();