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

tabindex

Skill này làm gì

Skill này kiểm tra cách dùng thuộc tính tabindex trên các trang web. Skill dành cho lập trình viên và người biên tập muốn trang hoạt động tốt với bàn phím và trình đọc màn hình.

Khi nào nên dùng

  • ✓Khi một trang có giá trị tabindex dương làm thay đổi thứ tự Tab bình thường.
  • ✓Khi các nút hoặc widget tùy chỉnh không thể tới được bằng phím Tab.
  • ✓Khi một đợt rà soát trợ năng báo lỗi về thứ tự focus.

Liên kết skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/tabindex/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/tabindex/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

“Bấm Tab trên site của tôi thì con trỏ nhảy lung tung. Bạn có thể kiểm tra cài đặt tabindex 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 giá trị tabindex làm phá vỡ thứ tự tự nhiên và sửa lại. Các điều khiển tùy chỉnh được đặt giá trị bằng 0 để người dùng bàn phím có thể tới được.

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.

Use appropriate tabindex values

Incorrect tabindex values can create a confusing navigation experience, making it difficult for keyboard users to predict where focus will move next.

Quick Reference

  • Stick to tabindex="0" for custom interactive elements
  • Use tabindex="-1" for elements that should only be focusable via script
  • Avoid positive values (1, 2, 3...) which break natural tab order

Check

Check for any positive tabindex values and ensure custom interactive elements are focusable.

Fix

Remove positive tabindex values and use tabindex="0" or -1 appropriately.

Explain

Explain why positive tabindex values are problematic for keyboard navigation and user experience.

Code Review

Review the rendered markup and interactive states that affect Use appropriate tabindex values. 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/tabindex

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

tabindex 0 làm gì?

Nó giúp một phần tử tùy chỉnh có thể tới bằng phím Tab, đúng theo vị trí của nó trong thứ tự trang.

Vì sao các số tabindex dương là vấn đề?

Chúng đưa phần tử lên đầu thứ tự Tab, khiến trang khó đoán với người dùng bàn phím.

Tôi có nên kiểm tra nút và liên kết có sẵn trước không?

Có. Skill khuyên kiểm tra các phần tử HTML gốc trước, vì chúng thường là lựa chọn tốt hơn.

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 Use appropriate tabindex values. 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
#3044
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ự