fix: safe editor

This commit is contained in:
Philipinho
2026-06-20 23:12:32 +01:00
parent d99d321e4a
commit e44ce2714f
15 changed files with 49 additions and 20 deletions
@@ -42,6 +42,10 @@ export const useEditorScroll = ({
return;
}
if (editor.isDestroyed) {
resolve(false);
return;
}
const dom = editor.view.dom.querySelector(`[id="${targetId}"], [data-id="${targetId}"]`);
if (dom) {
dom.scrollIntoView({ behavior: 'smooth', block: 'start' });