Skip to content

Commit 2ca0e51

Browse files
committed
fix(marketing): close the language picker when focus leaves it
1 parent 471dac1 commit 2ca0e51

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎apps/marketing/src/layouts/Layout.astro‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ const canonicalUrl = new URL(Astro.url.pathname, Astro.site);
218218
picker.open = false;
219219
picker.querySelector("summary")?.focus();
220220
});
221+
picker.addEventListener("focusout", (event) => {
222+
const next = event.relatedTarget as Node | null;
223+
if (next && !picker.contains(next)) picker.open = false;
224+
});
221225
}
222226
</script>
223227
</body>

0 commit comments

Comments
 (0)