Skip to content

fix: the svg elements has no accessible name#2307

Merged
PeachScript merged 1 commit intoumijs:masterfrom
huangkevin-apr:fix-a11y-bug-homepage
Jan 30, 2026
Merged

fix: the svg elements has no accessible name#2307
PeachScript merged 1 commit intoumijs:masterfrom
huangkevin-apr:fix-a11y-bug-homepage

Conversation

@huangkevin-apr
Copy link
Contributor

🤔 这个变动的性质是?/ What is the nature of this change?

  • 新特性提交 / New feature
  • bug 修复 / Fix bug
  • 样式优化 / Style optimization
  • 代码风格优化 / Code style optimization
  • 性能优化 / Performance optimization
  • 构建优化 / Build optimization
  • 网站、文档、Demo 改进 / Website, documentation, demo improvements
  • 重构代码或样式 / Refactor code or style
  • 测试相关 / Test related
  • 其他 / Other

🔗 相关 Issue / Related Issue

N/A
(Accessibility issues identified via IBM Equal Access Accessibility Checker)

💡 需求背景和解决方案 / Background or solution

Background

IBM Equal Access Accessibility Checker reports multiple violations in website (https://d.umijs.org/):

The SVG element has no accessible name
A non-decorative SVG element must have an accessible name.

The affected SVG icons are non-decorative and user-facing, including:

  • Color mode switch icons (Dark / Light / Auto)
  • RTL / LTR switch icons
  • Search bar icon
  • Social media icons

Without accessible names, these icons are not properly announced by screen readers, which violates WCAG – 1.1.1 Non-text Content and ARIA SVG accessibility requirements.

Solution

This PR adds proper accessible names to all affected SVG icons by:

  • Adding a <title> element to inline SVGs
  • Passing a semantic title prop to reusable SVG components

This ensures that all non-decorative SVG elements expose meaningful accessible names to assistive technologies.

✅ 测试说明 / Testing

  • Verified using IBM Equal Access Accessibility Checker
  • Confirmed that all previously reported “SVG element has no accessible name” violations are resolved

Fix Before:

image

Fix After:

image
  • The patch submitted in this PR was generated by A11YRepair, an automated Web Accessibility repair tool that I developed to address common accessibility violations in web applications. The generated fixes were manually reviewed and validated before submission.

📝 更新日志 / Changelog

Language Changelog
🇺🇸 English Fixed accessibility issues by adding accessible names to non-decorative SVG icons (theme switchers, RTL/LTR switcher, search bar, and social icons). Improves screen reader support without affecting visual appearance or behavior.
🇨🇳 Chinese 为主题切换、RTL/LTR 切换、搜索栏及社交图标中的非装饰性 SVG 元素补充可访问名称,修复无障碍违规问题,提升屏幕阅读器支持,不影响现有视觉效果和交互行为。

@vercel
Copy link

vercel bot commented Jan 7, 2026

@huangkevin-apr is attempting to deploy a commit to the chencheng's projects Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 29, 2026

More templates

dumi

npm i https://pkg.pr.new/umijs/dumi@2307

dumi-assets-types

npm i https://pkg.pr.new/umijs/dumi/dumi-assets-types@2307

@dumijs/vue-meta

npm i https://pkg.pr.new/umijs/dumi/@dumijs/vue-meta@2307

father-plugin-dumi-theme

npm i https://pkg.pr.new/umijs/dumi/father-plugin-dumi-theme@2307

@dumijs/preset-vue

npm i https://pkg.pr.new/umijs/dumi/@dumijs/preset-vue@2307

dumi-theme-mobile

npm i https://pkg.pr.new/umijs/dumi/dumi-theme-mobile@2307

commit: 02e92e0

@PeachScript PeachScript changed the title Fix A11Y Bugs: The SVG element has no accessible name fix: the svg elements has no accessible name Jan 30, 2026
@PeachScript PeachScript merged commit 3f786c9 into umijs:master Jan 30, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants