Count a bottom bar that stops above the home indicator when placing the rail

This commit is contained in:
Jonathan Sykes
2026-09-22 14:33:31 +08:00
parent c9e021a045
commit aa92fb1f05

View File

@@ -5590,8 +5590,12 @@ const SectionRail = (() => {
if (!el || el.classList.contains('hidden')) continue; if (!el || el.classList.contains('hidden')) continue;
const box = el.getBoundingClientRect(); const box = el.getBoundingClientRect();
if (!box.height) continue; if (!box.height) continue;
// Only count it when it really is pinned to the bottom edge. if (getComputedStyle(el).position !== 'fixed') continue;
if (box.bottom >= window.innerHeight - 4) occupied = Math.max(occupied, window.innerHeight - box.top); // Count any fixed bar sitting in the lower half. It must NOT be required
// to touch the viewport bottom: on an iPhone XR the bottom nav ends
// above the home-indicator gap, so a "bottom >= innerHeight" test missed
// it entirely and the rail was parked underneath it.
if (box.top > window.innerHeight * 0.5) occupied = Math.max(occupied, window.innerHeight - box.top);
} }
const want = Math.round(occupied + 14); const want = Math.round(occupied + 14);
if (st.bottom !== want) { if (st.bottom !== want) {