Skip to content

Commit 173a9f2

Browse files
committed
fix: popover not blurred in chromium
1 parent 56eff3e commit 173a9f2

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed

src/components/Header.astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ const { focus } = Astro.props;
7777
<HamburgerButton client:visible {links} />
7878
</div>
7979
</div>
80+
<div id="menu-popover-slot" class="absolute w-full"></div>
8081
</header>
8182

8283
<style>

src/islands/svelte/hamburger-button.svelte

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,25 @@
1313
</Popover.Trigger>
1414

1515
<Popover.Content align="end" side="bottom" strategy="fixed">
16-
<div
17-
transition:fade|global={{ duration: 70 }}
18-
class="w-[100vw] bg-gray-50/70 backdrop-blur-lg transition-opacity duration-300 lg:hidden"
19-
>
20-
<ul>
21-
{#each links as link}
22-
<li class="hover:bg-gray-100">
23-
<a
24-
href={link.href}
25-
class="block px-4 py-2"
26-
data-astro-prefetch="viewport"
27-
>
28-
{link.title}
29-
</a>
30-
</li>
31-
{/each}
32-
</ul>
33-
</div>
16+
<Popover.Portal to="#menu-popover-slot">
17+
<div
18+
transition:fade|global={{ duration: 70 }}
19+
class="w-full bg-gray-50/70 backdrop-blur-md lg:hidden"
20+
>
21+
<ul>
22+
{#each links as link}
23+
<li class="hover:bg-gray-100">
24+
<a
25+
href={link.href}
26+
class="block px-4 py-2"
27+
data-astro-prefetch="viewport"
28+
>
29+
{link.title}
30+
</a>
31+
</li>
32+
{/each}
33+
</ul>
34+
</div>
35+
</Popover.Portal>
3436
</Popover.Content>
3537
</Popover.Root>

0 commit comments

Comments
 (0)