From d758fc2d20c90cce2ec92b6a0fcd094350af414d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Sun, 3 May 2026 17:53:09 +0200 Subject: [PATCH] fix scroll to page not working after switching editors --- client/components/codeEditor/codeEditor.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/components/codeEditor/codeEditor.jsx b/client/components/codeEditor/codeEditor.jsx index 5f46fc3e4..d74bba01a 100644 --- a/client/components/codeEditor/codeEditor.jsx +++ b/client/components/codeEditor/codeEditor.jsx @@ -184,7 +184,7 @@ const CodeEditor = forwardRef( const createExtensions = ({ onChange, language, editorTheme })=>{ const setEventListeners = EditorView.updateListener.of((update)=>{ if(update.docChanged) { - recomputePages(update.state.doc); + tab === 'brewText' && recomputePages(update.state.doc); onChange(update.state.doc.toString()); } if(update.selectionSet) { @@ -250,7 +250,7 @@ const CodeEditor = forwardRef( extensions : createExtensions({ onChange, language, editorTheme }), }); - recomputePages(state.doc); + tab === 'brewText' && recomputePages(state.doc); viewRef.current = new EditorView({ state,