Lift mobile docks and FABs above the bottom tab bar.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -78,8 +78,18 @@ let dragMoved = false;
|
||||
let dragOffsetX = 0;
|
||||
let dragOffsetY = 0;
|
||||
|
||||
function mobileTabbarPx(): number {
|
||||
if (typeof window === 'undefined' || viewport.value.w > 900) return 0;
|
||||
const bar = document.querySelector('.mobile-tabbar');
|
||||
if (bar instanceof HTMLElement) {
|
||||
const h = bar.getBoundingClientRect().height;
|
||||
if (h > 0) return h;
|
||||
}
|
||||
return 64;
|
||||
}
|
||||
|
||||
function defaultPos(): FabPos {
|
||||
const extra = viewport.value.w <= 900 ? 64 : 0;
|
||||
const extra = mobileTabbarPx();
|
||||
return {
|
||||
left: FAB_MARGIN_LEFT,
|
||||
top: Math.max(8, viewport.value.h - FAB_MARGIN_BOTTOM - extra - FAB_SIZE),
|
||||
@@ -88,7 +98,7 @@ function defaultPos(): FabPos {
|
||||
|
||||
function clampPos(pos: FabPos): FabPos {
|
||||
const margin = 8;
|
||||
const bottomGap = viewport.value.w <= 900 ? 64 : 0;
|
||||
const bottomGap = mobileTabbarPx();
|
||||
return {
|
||||
left: Math.min(Math.max(margin, pos.left), viewport.value.w - FAB_SIZE - margin),
|
||||
top: Math.min(
|
||||
|
||||
Reference in New Issue
Block a user