One CSS line fixes iOS Safari keyboard scroll bug in full-screen mobile editors
A developer building PenPage, a local-first WYSIWYG markdown notes app, discovered a persistent iOS Safari bug where opening the soft keyboard causes fixed-position toolbar and navigation elements to scroll off-screen. The issue only occurs when document content is shorter than the viewport, because iOS falls back to scrolling the document itself when the inner scroll container has nothing to scroll. The root cause is a known WebKit bug where the layout viewport shrinks upon keyboard appearance, breaking fixed and absolute positioning. The fix requires just one CSS line — adding a large padding-bottom to the editable container — so the inner scroll area always has content to absorb touch gestures. This prevents iOS from escalating scroll events to the document level, keeping fixed UI elements pinned without any JavaScript or global page-locking workarounds.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in