fix: handle info overlay clicks

This commit is contained in:
Yuri Karamian
2026-08-17 19:42:47 +02:00
parent 9ccbf3aff5
commit 45e3c389e4
+6 -3
View File
@@ -91,6 +91,10 @@
activeTab = isMobile ? 'about' : 'shortcuts'; activeTab = isMobile ? 'about' : 'shortcuts';
} }
function closeFromOverlay(event: MouseEvent) {
if (event.target === event.currentTarget) close();
}
function openLink(url: string) { function openLink(url: string) {
openUrl(url).catch(console.error); openUrl(url).catch(console.error);
} }
@@ -100,9 +104,8 @@
{#if $showInfo} {#if $showInfo}
<!-- svelte-ignore a11y_no_static_element_interactions --> <!-- svelte-ignore a11y_no_static_element_interactions -->
<div class="info-overlay" onclick={close} onkeydown={(e) => { if (e.key === 'Escape') close(); }}> <div class="info-overlay" onclick={closeFromOverlay} onkeydown={(e) => { if (e.key === 'Escape') close(); }}>
<!-- svelte-ignore a11y_no_static_element_interactions --> <div class="info-panel">
<div class="info-panel" onclick={(e) => e.stopPropagation()}>
<div class="info-header"> <div class="info-header">
<h2>Info</h2> <h2>Info</h2>
<button class="close-btn" onclick={close} aria-label="Close info"> <button class="close-btn" onclick={close} aria-label="Close info">