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