跳到正文
Skillpedia
网站与界面(前端)75k · #2822

draggable-accessibility

它能做什么

这项技能检查网站上的拖放功能,使无法使用鼠标的人仍然可以使用它们。适合构建可移动或可排序项目的开发者。

适用场景

  • ✓当网站上的项目可以被拖动以重新排序或移动时。
  • ✓当键盘用户无法在页面上移动项目时。
  • ✓当你希望屏幕阅读器播报拖动操作时。

技能链接

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

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/draggable-accessibility/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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.

repo: thedaviddias/Front-End-Checklist

热度

GitHub 星标
75k
排名
#2822
许可证
MIT
更新时间
2026/10/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能