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

focus-not-obscured

Skill này làm gì

Skill này kiểm tra xem các phần tử cố định trên trang có che mục đang có focus bàn phím hay không. Skill dành cho lập trình viên xây menu dính, banner cookie và widget chat.

Khi nào nên dùng

  • ✓Khi một header dính che một liên kết khi bạn Tab qua trang.
  • ✓Khi một banner cookie che ô nhập mà người dùng bàn phím đang điền.
  • ✓Khi bạn thêm nút chat hoặc thanh khuyến mãi cố định trên màn hình.

Liên kết skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/focus-not-obscured/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/focus-not-obscured/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ạn có thể kiểm tra header dính của tôi không che các liên kết đang focus khi tôi dùng phím Tab không?”

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

Cách hoạt động

Agent kiểm tra focus bàn phím khi các phần tử dính đang hiển thị và tìm các trường hợp mục đang focus bị cuộn ra sau chúng. Agent gợi ý scroll-padding hoặc thay đổi kích thước lớp phủ.

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.

Keep focused elements unobscured

A visible focus ring is not enough if the focused element sits behind a sticky header or footer. Keyboard users need to see the actual focused control and the focus indicator at the same time in order to continue the task.

Quick Reference

  • Sticky UI must not cover the focused control while keyboard users tab through the page
  • Use scroll-padding or equivalent spacing when fixed headers or footers are present
  • Test with cookie banners, chat widgets, and consent bars open
  • Re-test at zoomed and mobile layouts where overlap problems usually appear

Check

Audit keyboard focus with all sticky UI active. Check headers, footers, cookie banners, promo bars, and chat launchers for cases where the focused element scrolls underneath them.

Fix

Add layout spacing such as scroll-padding, reduce overlay height, or change focus/scroll behavior so the focused element remains visible when tabbing.

Explain

Explain WCAG Focus Not Obscured, why fixed-position UI commonly breaks it, and how scroll-padding and overlay layout choices prevent the issue.

Code Review

Review sticky layout, focus styles, overlays, and keyboard navigation related to Keep focused elements unobscured. Flag exact selectors, breakpoints, or UI states where focused controls can be covered.


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

Rule page: https://frontendchecklist.io/rules/accessibility/focus-not-obscured

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

scroll-padding là gì?

Đó là cài đặt CSS chừa lại khoảng trống ở đầu hoặc cuối khi trình duyệt cuộn đến một mục đang focus, để mục đó vẫn nhìn thấy.

Skill kiểm tra những phần tử nào?

Header, footer, banner cookie, thanh khuyến mãi và nút chat.

Các vấn đề này thường xuất hiện khi nào?

Skill nói các vấn đề chồng lấp thường xuất hiện ở bố cục khi thu phóng và trên di động, nên khuyên kiểm thử lại ở các bố cục đó.

Chi tiết

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

Use when reviewing sticky navigation, consent banners, chat widgets, skip links, or any fixed-position UI. Validate the actual tab order and viewport behavior at realistic zoom levels.

repo: thedaviddias/Front-End-Checklist

Độ phổ biến

Sao GitHub
75k
Vị trí xếp hạng
#2850
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ự