Skip to content

fix: toolbar off-screen on iPad Safari with tabs#34

Merged
Ark0N merged 1 commit intoArk0N:masterfrom
arnlaugsson:fix/ipad-safari-toolbar-viewport
Mar 11, 2026
Merged

fix: toolbar off-screen on iPad Safari with tabs#34
Ark0N merged 1 commit intoArk0N:masterfrom
arnlaugsson:fix/ipad-safari-toolbar-viewport

Conversation

@arnlaugsson
Copy link
Contributor

@arnlaugsson arnlaugsson commented Mar 8, 2026

Summary

  • On iPad Safari with the tab bar visible, 100vh extends behind the browser chrome, pushing the fixed-position toolbar out of view
  • Adds viewport-fit=cover to viewport meta tag for proper safe area inset support
  • Uses 100dvh (dynamic viewport height) with 100vh fallback for body and .app
  • Sets --app-height CSS variable from visualViewport.height via JS in MobileDetection
  • Offsets the fixed toolbar on iOS Safari using the delta between layout and visual viewport

Test plan

  • Open Codeman on iPad Safari with tab bar visible — toolbar should be fully visible
  • Verify toolbar remains visible when switching tabs in Safari
  • Verify keyboard handling still works (toolbar moves above keyboard)
  • Verify desktop browser layout is unaffected
  • Verify iPhone Safari layout is unaffected

Proofs

image
image

On iPad Safari with the tab bar visible, `100vh` extends behind the
browser chrome, pushing the fixed-position toolbar out of view.

- Add `viewport-fit=cover` to viewport meta tag
- Use `100dvh` with `100vh` fallback for body/.app height
- Set `--app-height` CSS variable from `visualViewport.height` via JS
- Offset fixed toolbar on iOS Safari using the layout/visual viewport delta
@Ark0N
Copy link
Owner

Ark0N commented Mar 9, 2026

thanks for the input, I will check tomorrow in detail :-)

@arnlaugsson
Copy link
Contributor Author

I will put this into a draft PR, as I haven't been able to test this thoroughly on other devices. Will do tonight!

@arnlaugsson arnlaugsson marked this pull request as draft March 9, 2026 08:59
@Ark0N
Copy link
Owner

Ark0N commented Mar 11, 2026

I did some tests on my iPad Mini, it still looks like the same as in your screenshots, so lets see how to fix it

@Ark0N
Copy link
Owner

Ark0N commented Mar 11, 2026

Thanks for the contribution! The core viewport fix is solid — merged the 100dvh progressive enhancement, viewport-fit=cover, and the visualViewport-based --app-height CSS variable approach.

I made one adjustment: scoped the .ios-device.safari-browser .toolbar { bottom: calc(...) } rule to @media (max-width: 430px) where the toolbar is position: fixed. On iPad (768px) the toolbar is position: relative in the flow, so the body/app height fix alone handles it correctly — the global bottom offset was double-correcting and creating a gap.

Some minor styling details (keyboard accessory bar appearance on tablet, etc.) will be addressed in upcoming mobile optimization work. 👍

@Ark0N Ark0N marked this pull request as ready for review March 11, 2026 00:26
@Ark0N Ark0N merged commit 8b8907c into Ark0N:master Mar 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants