Skip to content

Commit 1c357d9

Browse files
committed
fix(mobile-nav): defer modal open after close; respect safe-area inset
1 parent 7003e0c commit 1c357d9

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

app/components/Header/MobileBottomBar.client.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function handleThemeClick() {
5050
<template>
5151
<Teleport to="body">
5252
<div
53-
class="sm:hidden fixed inset-x-0 bottom-0 z-50 bg-bg border-t border-border flex items-center gap-2 px-3 h-14 transition-transform duration-200 ease-out motion-reduce:transition-none"
53+
class="sm:hidden fixed inset-x-0 bottom-0 z-50 bg-bg border-t border-border flex items-center gap-2 px-3 h-14 pb-[env(safe-area-inset-bottom)] transition-transform duration-200 ease-out motion-reduce:transition-none"
5454
:class="hidden ? 'translate-y-full' : 'translate-y-0'"
5555
:style="{ '--mobile-bar-height': '3.5rem' }"
5656
>

app/components/Header/MobileMenuSheet.client.vue

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,21 @@ function handleOpenCommandPalette() {
1717
nextTick(() => openCommandPalette())
1818
}
1919
20+
function showDialogAfterClose(selector: string) {
21+
const modal = document.querySelector<HTMLDialogElement>(selector)
22+
if (!modal) return
23+
close()
24+
nextTick(() => {
25+
if (!modal.open) modal.showModal()
26+
})
27+
}
28+
2029
function handleShowConnector() {
21-
const modal = document.querySelector<HTMLDialogElement>('#connector-modal')
22-
if (modal) {
23-
close()
24-
modal.showModal()
25-
}
30+
showDialogAfterClose('#connector-modal')
2631
}
2732
2833
function handleShowAuth() {
29-
const modal = document.querySelector<HTMLDialogElement>('#auth-modal')
30-
if (modal) {
31-
close()
32-
modal.showModal()
33-
}
34+
showDialogAfterClose('#auth-modal')
3435
}
3536
3637
const route = useRoute()

0 commit comments

Comments
 (0)