a tool for shared writing and social publishing

small adjustment for better scrolling on page focus

+5 -1
+5 -1
components/Blocks/Block.tsx
··· 32 32 import { HorizontalRule } from "./HorizontalRule"; 33 33 import { deepEquals } from "src/utils/deepEquals"; 34 34 import { isTextBlock } from "src/utils/isTextBlock"; 35 + import { focusPage } from "src/utils/focusPage"; 35 36 36 37 export type Block = { 37 38 factID: string; ··· 62 63 // Block handles all block level events like 63 64 // mouse events, keyboard events and longPress, and setting AreYouSure state 64 65 // and shared styling like padding and flex for list layouting 65 - 66 + let { rep } = useReplicache(); 66 67 let mouseHandlers = useBlockMouseHandlers(props); 67 68 let handleDrop = useHandleDrop({ 68 69 parent: props.parent, ··· 87 88 88 89 let [areYouSure, setAreYouSure] = useState(false); 89 90 useEffect(() => { 91 + if (selected && rep) { 92 + focusPage(props.parent, rep); 93 + } 90 94 if (!selected) { 91 95 setAreYouSure(false); 92 96 }