a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

prevent scroll jumping on android, and when focusing same block on ios

+18 -8
+9
app/layout.tsx
··· 12 12 metadataBase: `https://leaflet.pub`, 13 13 }; 14 14 15 + export const viewport = { 16 + minimumScale: 1, 17 + initialScale: 1, 18 + maximumScale: 1, 19 + width: "device-width", 20 + viewportFit: "cover", 21 + interactiveWidget: "resizes-content", 22 + }; 23 + 15 24 export const preferredRegion = ["sfo1"]; 16 25 17 26 const quattro = localFont({
+3 -6
components/Blocks/TextBlock/index.tsx
··· 66 66 )} 67 67 {permission && !props.preview && !isLocked?.data.value && ( 68 68 <div 69 - className={`w-full relative group/text ${!initialized ? "hidden" : ""}`} 69 + className={`w-full relative group ${!initialized ? "hidden" : ""}`} 70 70 > 71 71 <IOSBS {...props} /> 72 72 <BaseTextBlock {...props} /> ··· 77 77 } 78 78 79 79 export function IOSBS(props: BlockProps) { 80 - let selected = useUIState((s) => 81 - s.selectedBlocks.find((b) => b.value === props.entityID), 82 - ); 83 80 let [initialRender, setInitialRender] = useState(true); 84 81 useEffect(() => { 85 82 setInitialRender(false); 86 83 }, []); 87 - if (selected || initialRender || !isIOS()) return null; 84 + if (initialRender || !isIOS()) return null; 88 85 return ( 89 86 <div 90 - className="h-full w-full absolute cursor-text" 87 + className="h-full w-full absolute cursor-text group-focus-within:hidden" 91 88 onMouseDown={(e) => { 92 89 e.preventDefault(); 93 90 focusBlock(props, {
+6 -2
components/ViewportSizeLayout.tsx
··· 1 1 "use client"; 2 - import { useViewportSize } from "@react-aria/utils"; 2 + import { isIOS, useViewportSize } from "@react-aria/utils"; 3 3 import { useEffect, useState } from "react"; 4 4 5 5 export function ViewportSizeLayout(props: { children: React.ReactNode }) { 6 6 let viewheight = useViewportSize().height; 7 7 let difference = useViewportDifference(); 8 - return <div style={{ height: viewheight || "100%" }}>{props.children}</div>; 8 + return ( 9 + <div style={{ height: isIOS() ? viewheight : "100%" }}> 10 + {props.children} 11 + </div> 12 + ); 9 13 } 10 14 11 15 function useViewportDifference(): number {