Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)75k · #2738

aria-text

Skill này làm gì

Skill này kiểm tra các vùng có role text mà bên trong chứa mục tương tác, khiến trình đọc màn hình bỏ qua chúng. Skill dành cho lập trình viên gắn role text lên phần tử bao ngoài.

Khi nào nên dùng

  • ✓Khi một thẻ hoặc phần bao ngoài có role text chứa link hoặc nút.
  • ✓Khi trình đọc màn hình bỏ qua các điều khiển nằm trong một khối.
  • ✓Khi bạn rà soát các component đặt role text lên phần tử bao ngoài.

Liên kết skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/aria-text/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/aria-text/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Hãy kiểm tra xem có vùng bao role text nào trên trang của tôi chứa nút hoặc link mà người dùng không thể chạm tới không.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent tìm các phần tử có role text mà bên trong có phần tử focus được, rồi bỏ role hoặc chuyển các mục tương tác ra khỏi vùng đó.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Avoid focusable descendants in role="text" elements

Using role="text" on a container forces screen readers to treat everything inside as a single string of text, which effectively hides any interactive elements from users who rely on assistive technology.

Quick Reference

  • Elements with role="text" should not contain interactive children (links, buttons)
  • Ensure role="text" only contains static text content
  • Prevent accessibility "black holes" where interactive items are hidden from screen readers

Check

Identify elements with role="text" and verify they do not contain any focusable elements like buttons, links, or inputs.

Fix

Remove role="text" from containers that have interactive children or move the interactive elements outside.

Explain

Explain how role="text" overrides the semantics of descendant elements, making interactive components inaccessible to screen reader users.

Code Review

Review the rendered markup and interactive states that affect Avoid focusable descendants in role="text" elements. Flag exact elements, roles, labels, focus behavior, or keyboard interactions that violate the rule, and note how to verify the fix with browser accessibility tooling or assistive tech.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/accessibility/aria-text

Câu hỏi thường gặp

Vì sao role text lại gây lỗi?

Skill nói rằng nó khiến mọi thứ bên trong được đọc như một chuỗi văn bản duy nhất, làm người dùng trình đọc màn hình không thấy các phần tương tác.

Cách sửa là gì?

Bỏ role text khỏi các vùng có phần tử con tương tác, hoặc đưa các phần tử con đó ra ngoài vùng.

Role text chỉ nên chứa gì?

Skill nói rằng nó chỉ nên chứa nội dung văn bản tĩnh.

Chi tiết

Mô tả gốc của tác giả

Use when reviewing rendered HTML, interactive components, or design-system patterns related to Avoid focusable descendants in role='text' elements. Check native semantics first, then inspect keyboard behavior, focus flow, accessible names, and screen-reader output where relevant.

repo: thedaviddias/Front-End-Checklist

Độ phổ biến

Sao GitHub
75k
Vị trí xếp hạng
#2738
Giấy phép
MIT
Cập nhật
31/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự