From 10f4e467e91235aa791b501eec448a8abe3dabe3 Mon Sep 17 00:00:00 2001 From: celine Date: Wed, 14 Jan 2026 15:53:37 -0500 Subject: [PATCH] small adjustment for better scrolling on page focus --- components/Blocks/Block.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/Blocks/Block.tsx b/components/Blocks/Block.tsx index 0e899749..1f7ca9bb 100644 --- a/components/Blocks/Block.tsx +++ b/components/Blocks/Block.tsx @@ -32,6 +32,7 @@ import { CodeBlock } from "./CodeBlock"; import { HorizontalRule } from "./HorizontalRule"; import { deepEquals } from "src/utils/deepEquals"; import { isTextBlock } from "src/utils/isTextBlock"; +import { focusPage } from "src/utils/focusPage"; export type Block = { factID: string; @@ -62,7 +63,7 @@ export const Block = memo(function Block( // Block handles all block level events like // mouse events, keyboard events and longPress, and setting AreYouSure state // and shared styling like padding and flex for list layouting - + let { rep } = useReplicache(); let mouseHandlers = useBlockMouseHandlers(props); let handleDrop = useHandleDrop({ parent: props.parent, @@ -87,6 +88,9 @@ export const Block = memo(function Block( let [areYouSure, setAreYouSure] = useState(false); useEffect(() => { + if (selected && rep) { + focusPage(props.parent, rep); + } if (!selected) { setAreYouSure(false); } -- 2.51.2