FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Why CSS dvh ignores the mobile keyboard — and how to fix it
How-ToWeb Development

Why CSS dvh ignores the mobile keyboard — and how to fix it

via Dev.toGichan4h ago

CSS dvh (dynamic viewport height) was introduced to replace the infamous 100vh bug on mobile. It handles the browser URL bar appearing and disappearing — but it completely ignores the on-screen keyboard. When the keyboard opens, position: fixed elements get covered. dvh won't help you here. Why dvh ignores the keyboard The CSS viewport units spec treats the virtual keyboard as an overlay — it doesn't resize the layout viewport. So dvh , svh , and 100vh all stay the same value when the keyboard opens. The real fix: Visual Viewport API keyboardHeight = window . innerHeight - window . visualViewport . height When the keyboard opens, visualViewport.height shrinks while window.innerHeight stays fixed. The difference is the keyboard height. But there's a catch — iOS Safari and Android Chrome behave differently. iOS Safari When the keyboard opens, iOS scrolls the visual viewport upward. visualViewport.offsetTop increases. It fires both resize and scroll events on visualViewport — but window r

Continue reading on Dev.to

Opens in a new tab

Read Full Article
0 views

Related Articles

Welcome Thread - v372
How-To

Welcome Thread - v372

Dev.to • 37m ago

ShadCN UI in 2026: the component library that changed how we build UIs
How-To

ShadCN UI in 2026: the component library that changed how we build UIs

Dev.to • 7h ago

Why OpenClaw Agents Lose Their Minds Mid-Session (And What It Takes to Fix It)
How-To

Why OpenClaw Agents Lose Their Minds Mid-Session (And What It Takes to Fix It)

Dev.to • 8h ago

How-To

Logos Privacy Builders Bootcamp

Reddit Programming • 22h ago

#05 Frozen Pipes
How-To

#05 Frozen Pipes

Dev.to • 1d ago

Discover More Articles