draggable-accessibility
它能做什么
这项技能检查网站上的拖放功能,使无法使用鼠标的人仍然可以使用它们。适合构建可移动或可排序项目的开发者。
适用场景
- ✓当网站上的项目可以被拖动以重新排序或移动时。
- ✓当键盘用户无法在页面上移动项目时。
- ✓当你希望屏幕阅读器播报拖动操作时。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/draggable-accessibility/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“你能让我页面上的拖放列表可以用键盘操作吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会检查键盘替代方式,例如方向键和 Enter 键,以及状态播报。它会建议添加描述每个操作的 ARIA 属性和实时消息。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Make drag and drop accessible
Drag and drop is mouse-dependent by default—keyboard and screen reader users are completely locked out without proper alternatives and ARIA announcements.
Quick Reference
- Always provide keyboard alternatives to drag and drop
- Use aria-grabbed and aria-dropeffect (or newer attributes)
- Announce drag operations to screen readers via live regions
- Support both mouse/touch and keyboard interaction patterns
Check
Verify drag and drop interfaces have keyboard alternatives, proper ARIA attributes, and live region announcements.
Fix
Implement keyboard alternatives (arrow keys, Enter/Space), aria-grabbed, aria-dropeffect, and status announcements.
Explain
Explain how accessible drag and drop implementations provide equivalent functionality for keyboard and screen reader users.
Code Review
Review templates, server-rendered HTML, and shared components that output markup related to Make drag and drop accessible. Flag exact elements, attributes, and routes where the rendered HTML violates the rule.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/html/draggable-accessibility
常见问题
为什么键盘替代方式很重要?
没有它们,无法使用鼠标的人就无法使用这项功能。
什么是 live region?
它们是页面中的区域,当其文字变化时屏幕阅读器会将其读出,可以用来播报拖动的进度。
它提到了哪些 ARIA 属性?
它提到了 aria-grabbed 和 aria-dropeffect,或取代它们的较新属性。
详情
作者的原始描述
Use when reviewing templates, rendered HTML, or shared components related to Make drag and drop accessible. Validate the final browser-facing markup, not just the source framework abstraction.
热度
- GitHub 星标
- 75k
- 排名
- #2822
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。