mirror of
https://github.com/logseq/logseq.git
synced 2026-05-27 14:14:24 +00:00
fix(a11y): mark avatar image as decorative with explicit empty alt
shui/avatar-image was called without an :alt prop, which leaves the underlying <img> with no alt attribute — some screen readers fall back to announcing the URL or filename. The avatar is always rendered next to its label (page/block title), which the screen reader already announces. Passing the title as alt would double-announce; the right call is explicit empty alt to mark the image as decorative per WCAG. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -579,6 +579,11 @@
|
||||
;; Image (shows when loaded, circular with cover fit)
|
||||
(when url
|
||||
(shui/avatar-image {:src url
|
||||
;; Decorative: the avatar is always rendered next
|
||||
;; to its label (page/block title), which the
|
||||
;; screen reader already announces. Content-
|
||||
;; bearing alt would double-announce.
|
||||
:alt ""
|
||||
:style {:object-fit "cover"}
|
||||
:data-shape (name shape)}))
|
||||
;; Fallback (shows while loading, on error, OR when there's no image
|
||||
|
||||
Reference in New Issue
Block a user