a tool for shared writing and social publishing
1import { isIOS } from "./isDevice"; 2 3export function onMouseDown(e: React.MouseEvent<HTMLInputElement>) { 4 if (!isIOS()) return; 5 e.preventDefault(); 6 let target = e.currentTarget; 7 target.style.transform = "translateY(-2000px)"; 8 if (target.type === "text") target.setSelectionRange(0, target.value.length); 9 target.focus(); 10 requestAnimationFrame(() => { 11 target.style.transform = ""; 12 }); 13}