From 38da924add0a76fd9830f89c639074402637e442 Mon Sep 17 00:00:00 2001 From: thornbill Date: Tue, 27 Jan 2026 16:22:33 -0500 Subject: [PATCH] Backport pull request #7514 from jellyfin-web/release-10.11.z Fix card and item list accessibility issues Original-merge: cfc39f99832636bb751824e1c7ab5597d08a8701 Merged-by: thornbill Backported-by: thornbill --- src/components/cardbuilder/card.scss | 19 +++++++++++++------ src/components/cardbuilder/cardBuilder.js | 8 ++------ src/components/listview/listview.js | 10 +++++----- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/components/cardbuilder/card.scss b/src/components/cardbuilder/card.scss index 737850261..a013b34d6 100644 --- a/src/components/cardbuilder/card.scss +++ b/src/components/cardbuilder/card.scss @@ -826,6 +826,13 @@ button::-moz-focus-inner { right: 0; user-select: none; border-radius: 0.2em; + + /** Disable pointer events for the overlay container, but allow them for its children */ + pointer-events: none; + + * { + pointer-events: auto; + } } .visualCardBox .blurhash-canvas, @@ -835,10 +842,6 @@ button::-moz-focus-inner { border-bottom-right-radius: 0; } -.card-hoverable:hover .cardOverlayContainer { - opacity: 1; -} - .cardOverlayButton-hover { opacity: 0; transition: 0.2s; @@ -850,8 +853,12 @@ button::-moz-focus-inner { background: transparent !important; } -.card-hoverable:hover .cardOverlayButton-hover { - opacity: 1; +.card-hoverable:focus-within, +.card-hoverable:hover { + .cardOverlayContainer, + .cardOverlayButton-hover { + opacity: 1; + } } .cardOverlayContainer > .cardOverlayFab-primary { diff --git a/src/components/cardbuilder/cardBuilder.js b/src/components/cardbuilder/cardBuilder.js index 9b7392d7f..45c5bba0c 100644 --- a/src/components/cardbuilder/cardBuilder.js +++ b/src/components/cardbuilder/cardBuilder.js @@ -1018,7 +1018,7 @@ function buildCard(index, item, apiClient, options) { cardImageContainerClose = ''; } else { - const cardImageContainerAriaLabelAttribute = ` aria-label="${escapeHtml(item.Name)}"`; + const cardImageContainerAriaLabelAttribute = ` aria-label="${escapeHtml(item.Name)}" role="img"`; const url = appRouter.getRouteUrl(item); // Don't use the IMG tag with safari because it puts a white border around it @@ -1150,15 +1150,11 @@ function getHoverMenuHtml(item, action) { let html = ''; html += '
'; - const url = appRouter.getRouteUrl(item, { - serverId: item.ServerId || ServerConnections.currentApiClient().serverId() - }); - html += ''; const btnCssClass = 'cardOverlayButton cardOverlayButton-hover itemAction paper-icon-button-light'; if (playbackManager.canPlay(item)) { - html += ``; + html += ``; } html += '
'; diff --git a/src/components/listview/listview.js b/src/components/listview/listview.js index da90749ca..e06041183 100644 --- a/src/components/listview/listview.js +++ b/src/components/listview/listview.js @@ -302,7 +302,7 @@ export function getListViewHtml(options) { } if (playOnImageClick) { - html += ``; + html += ``; } const progressHtml = indicators.getProgressBarHtml(item, { @@ -453,11 +453,11 @@ export function getListViewHtml(options) { if (!clickEntireItem) { if (options.addToListButton) { - html += ``; + html += ``; } if (options.infoButton) { - html += ``; + html += ``; } if (options.rightButtons) { @@ -478,7 +478,7 @@ export function getListViewHtml(options) { } if (options.moreButton !== false) { - html += ``; + html += ``; } } html += '
'; @@ -502,5 +502,5 @@ export function getListViewHtml(options) { } export default { - getListViewHtml: getListViewHtml + getListViewHtml };