/r/ReactJS - The Front Page of React
•
2026-04-08 08:49
dvh doesn't solve the mobile keyboard problem. I spent way too much time figuring out why, so I made a 0.8KB hook.
We've all been there — you're building a mobile chat UI or a bottom-anchored menu, the keyboard opens, and your input bar just disappears. You think, "I'll just use dvh, that's what it's for." Nope. By design, dvh only responds to browser UI elements like the URL bar. The virtual keyboard is intentionally treated as an overlay by browsers, so dvh, svh, and 100vh all stay the same value w...