fix(ui): keep album menu visible while open

This commit is contained in:
vicrodh committed 2026-01-14 02:05:29 -06:00
1 parent 5683f9b12e
commit 64af963608
2 files changed
+10 -3

No files matched your search

+5 -2
View File
@@ -65,6 +65,7 @@
const showFavoriteButton = $derived(showFavorite ?? !!albumId);
const favoriteAvailable = $derived(favoriteEnabled ?? !!albumId);
const hasOverlay = $derived(!!(showFavoriteButton || onPlay || hasMenu));
let menuOpen = $state(false);
function handleImageError() {
imageError = true;
@@ -159,7 +160,7 @@
<!-- Action Overlay -->
{#if hasOverlay}
<div class="action-overlay">
<div class="action-overlay" class:menu-open={menuOpen}>
<div class="action-buttons">
{#if showFavoriteButton}
<button
@@ -188,6 +189,7 @@
onShareQobuz={onShareQobuz}
onShareSonglink={onShareSonglink}
onDownload={onDownload}
onOpenChange={(open) => (menuOpen = open)}
/>
</div>
{/if}
@@ -289,7 +291,8 @@
}
.album-card:hover .action-overlay,
.action-overlay:focus-within {
.action-overlay:focus-within,
.action-overlay.menu-open {
opacity: 1;
}
+5 -1
View File
@@ -16,6 +16,7 @@
onShareQobuz?: () => void;
onShareSonglink?: () => void;
onDownload?: () => void;
onOpenChange?: (open: boolean) => void;
}
let {
@@ -23,7 +24,8 @@
onPlayLater,
onShareQobuz,
onShareSonglink,
onDownload
onDownload,
onOpenChange
}: Props = $props();
let isOpen = $state(false);
@@ -44,6 +46,7 @@
function closeMenu() {
isOpen = false;
shareOpen = false;
onOpenChange?.(false);
}
function handleClickOutside(event: MouseEvent) {
@@ -145,6 +148,7 @@
e.stopPropagation();
isOpen = !isOpen;
shareOpen = false;
onOpenChange?.(isOpen);
if (isOpen) setMenuPosition();
}}
aria-label="Album actions"