web: reset active block after scroll

This commit is contained in:
Abdullah Atta
2024-01-24 16:22:01 +05:00
parent 6e0404fe8b
commit 63ae8a4a86
2 changed files with 6 additions and 1 deletions

View File

@@ -819,6 +819,11 @@ function useScrollToBlock(id: string) {
useEffect(() => {
if (!blockId) return;
scrollIntoViewById(blockId);
useEditorStore
.getState()
.updateSession(id, ["default", "unlocked", "deleted"], {
activeBlockId: undefined
});
}, [blockId]);
}

View File

@@ -272,7 +272,7 @@ class EditorStore extends BaseStore<EditorStore> {
if (activeBlockId && session)
this.updateSession(session.id, [session.type], {
activeBlockId: activeBlockId
activeBlockId
});
};