Skip to content

Commit f4ebd5d

Browse files
committed
Allow a18y and tabbing in album grid.
1 parent a3d5bc7 commit f4ebd5d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

frontend/src/components/AlbumGrid.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,18 @@ interface AlbumProps {
1111

1212
const AlbumGridEntry: React.FC<AlbumProps> = ({ album, onClickAlbum }) => (
1313
<IonCol size="6" sizeMd="4" sizeLg="3" key={album.instance_id}>
14-
<div className="album-art-container" onClick={() => onClickAlbum(album)}>
14+
<div
15+
className="album-art-container"
16+
role="button"
17+
tabIndex={0}
18+
onClick={() => onClickAlbum(album)}
19+
onKeyDown={(e) => {
20+
if (e.key === "Enter" || e.key === " ") {
21+
e.preventDefault()
22+
onClickAlbum(album)
23+
}
24+
}}
25+
>
1526
<img
1627
src={album.image_base64 ? album.image_base64 : album.basic_information.thumb}
1728
className="album-art"

0 commit comments

Comments
 (0)