fix: Dialogs can now be correctly closed on mobile (#247)

This commit is contained in:
Mani
2026-01-25 05:01:11 +01:00
committed by GitHub
parent cdb5f41404
commit 505347face
3 changed files with 8 additions and 10 deletions
+6 -6
View File
@@ -105,9 +105,9 @@ export function ThemeSummaryCard({
const videoSlug = createVideoSlug(theme, entry, video);
const href = `/anime/${anime.slug}/${videoSlug}`;
function handleToggleExpand(event: MouseEvent) {
if (isLink(event.target)) {
event.stopPropagation();
function handleToggleExpand(event: MouseEvent, filterLinks = false) {
if (filterLinks && isLink(event.target)) {
return;
} else if (expandable && !isMobile) {
toggleExpanded();
}
@@ -124,11 +124,11 @@ export function ThemeSummaryCard({
return (
<StyledWrapper>
<SummaryCard onClick={handleToggleExpand} {...props}>
<SummaryCard {...props}>
<Link href={href} onClick={() => onPlay?.()}>
<SummaryCard.Cover src={smallCover} />
</Link>
<SummaryCard.Body>
<SummaryCard.Body onClick={(event) => handleToggleExpand(event, true)}>
<SummaryCard.Title>
<SongTitle song={theme.song} href={href} onClick={() => onPlay?.()} />
<Performances song={theme.song} artist={artist} />
@@ -143,7 +143,7 @@ export function ThemeSummaryCard({
</SummaryCard.Description>
</SummaryCard.Body>
{children}
<StyledOverlayButtons onClick={(event) => event.stopPropagation()}>
<StyledOverlayButtons>
<ThemeMenu theme={theme} />
{expandable && (
<StyledExpandButton
+1 -3
View File
@@ -110,9 +110,7 @@ export function VideoSummaryCard({
</SummaryCard.Description>
</SummaryCard.Body>
{menu !== null ? (
<StyledOverlayButtons onClick={(event) => event.stopPropagation()}>
{menu ?? <VideoMenu entry={entry} video={video} />}
</StyledOverlayButtons>
<StyledOverlayButtons>{menu ?? <VideoMenu entry={entry} video={video} />}</StyledOverlayButtons>
) : null}
{append}
</SummaryCard>
+1 -1
View File
@@ -99,5 +99,5 @@ VideoMenu.fragments = {
basename
}
}
`
`,
};