fix(nav): keep bottom tab bar flush to visible viewport on iOS Chrome
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 12s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 49s
Build and Push Docker Images / Build Pipeline (Meltano + dbt + Airflow) (push) Successful in 12s
Build and Push Docker Images / Trigger Portainer Update (push) Successful in 1s
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 12s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 49s
Build and Push Docker Images / Build Pipeline (Meltano + dbt + Airflow) (push) Successful in 12s
Build and Push Docker Images / Trigger Portainer Update (push) Successful in 1s
iOS Chrome (and some Android browsers) auto-hide their URL bar on scroll. This grows the visual viewport without changing the layout viewport, so a position:fixed bar pinned to bottom:0 — which is relative to the layout viewport — appears to float mid-screen with a gap beneath it. Safari masks the bug because its toolbar shrinks rather than fully retracting. Track the delta between the visual and layout viewports via the VisualViewport API and write it to a --mobile-bar-offset CSS var. The bar uses translate3d to apply that offset, which both fixes the gap and enables hardware compositing so it tracks the toolbar animation without flicker. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -233,5 +233,10 @@
|
||||
box-shadow: 0 -2px 12px rgba(26, 22, 18, 0.06);
|
||||
/* Respect iPhone home-indicator inset */
|
||||
padding-bottom: env(safe-area-inset-bottom, 0);
|
||||
/* Compensate for iOS Chrome's auto-hiding URL bar — Navigation.tsx
|
||||
writes the offset based on the Visual Viewport API. translate3d
|
||||
(instead of translateY) forces hardware compositing so the bar
|
||||
doesn't lag/flicker during the toolbar animation. */
|
||||
transform: translate3d(0, var(--mobile-bar-offset, 0px), 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user