Langsung ke konten
Skillpedia
Website & UI (frontend)75k · #2750

autofocus-avoidance

Fungsinya

Skill ini memeriksa apakah pemuatan halaman tidak memindahkan fokus ke kolom formulir secara tiba-tiba. Cocok untuk pengembang yang membangun halaman dengan formulir di bawah konten lain.

Kapan dipakai

  • ✓Saat sebuah halaman memiliki kolom formulir dengan autofocus di bawah judul atau teks pengantar.
  • ✓Saat pengguna pembaca layar melaporkan dibawa ke tengah halaman.
  • ✓Saat Anda meninjau halaman masuk atau pencarian yang memakai autofocus.

Link skill

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

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/autofocus-avoidance/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit →

Contoh permintaan ke AI

“Hapus autofocus dari formulir kontak di halaman layanan saya agar pengguna pembaca layar mulai dari atas.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent mencari atribut autofocus pada elemen formulir dan menghapusnya, atau mengatur fokus dengan JavaScript hanya setelah pengguna melakukan tindakan.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Avoid autofocus on form fields

Autofocus teleports screen reader users to mid-page without context—they miss everything before the form and have no idea where they landed.

Quick Reference

  • Avoid autofocus on pages with content before the form
  • Autofocus disrupts screen reader users who lose page context
  • Use JavaScript focus after user interaction instead of page load
  • Login and search-only pages are exceptions where autofocus may be acceptable

Check

Search for autofocus attributes on form elements. Verify that page load does not unexpectedly move focus away from the page top, especially on pages with content before the form.

Fix

Remove autofocus attributes from form elements. If focus management is needed, use JavaScript to set focus after user interaction rather than automatically on page load.

Explain

Explain how autofocus moves screen reader users to mid-page without context, can trigger unexpected scrolling, and disrupts users who were reading content before the focused element.

Code Review

Review the rendered markup and interactive states that affect Avoid autofocus on form fields. 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/autofocus-avoidance

Pertanyaan umum

Mengapa autofocus menjadi masalah?

Skill menyatakan pengguna pembaca layar kehilangan konteks dari semua yang ada sebelum formulir dan tidak tahu di mana mereka berada.

Apakah ada saat autofocus boleh dipakai?

Ya. Skill menyatakan halaman masuk dan halaman pencarian saja dapat menjadi pengecualian.

Bagaimana fokus sebaiknya diatur?

Dengan JavaScript, setelah pengguna berinteraksi dengan halaman.

Detail

Deskripsi asli dari pembuat

Use when reviewing rendered HTML, interactive components, or design-system patterns related to Avoid autofocus on form fields. Check native semantics first, then inspect keyboard behavior, focus flow, accessible names, and screen-reader output where relevant.

repo: thedaviddias/Front-End-Checklist

Popularitas

Bintang GitHub
75k
Peringkat
#2750
Lisensi
MIT
Diperbarui
31/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa