The editor's expanded platform preview doesn't work with the keyboard
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 85/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- react, typescript
调研方向
阅读 src/components/editor/PlatformPreviewStrip.tsx,重点关注平台卡片、遮罩层、对话框、平台名称和 Close 按钮。实现列出的焦点、Escape、Tab 限制、焦点恢复和对话框标注行为,同时保留点击背景关闭的功能。根据 issue 的键盘操作验收标准验证结果,然后运行 npm run check、npm run test 和 npm run build。
由索引模型根据 Issue 内容生成。
描述
In the editor (for example https://og.codercops.com/create/blog), Tab to one of the platform cards under the canvas and press Enter. The expanded preview opens, but:
- Focus stays on the card behind the overlay.
- Escape doesn't close it. The Escape handler is on the overlay (
src/components/editor/PlatformPreviewStrip.tsx, line 73), and the overlay doesn't have focus. - Tab keeps moving through the other seven cards underneath. After them it lands on the overlay itself, which is a
role="button"(lines 69 to 72) whose name is all the text in the preview. Only there does Escape work. - When it closes (Escape on the overlay, or the Close button), focus drops to the page body instead of going back to the card.
- The dialog (line 78) has no
aria-modaland no accessible name, so a screen reader doesn't say which platform it shows.
What to do
- Move focus into the dialog when it opens, for example to the Close button.
- Close it on Escape while it's open: listen for
keydownondocumentin auseEffectand remove the listener in the cleanup, or put the handler on the dialog. - Keep Tab inside the dialog while it's open (the viewport buttons and Close), so focus can't wander behind it.
- When it closes, put focus back on the card that opened it.
- Give the dialog
aria-modal="true"andaria-labelledbypointing at the platform name (line 82).useIdworks for the id. - Remove
role="button"andtabIndexfrom the overlay. Clicking the backdrop can still close it.
Where to look
src/components/editor/PlatformPreviewStrip.tsx: the cards (lines 41 to 54), the overlay (lines 68 to 74), the dialog (lines 75 to 80), the platform name (lines 82 to 84) and the Close button (lines 87 to 94)
Acceptance criteria
- Enter on a platform card opens the preview with focus inside it
- Escape and the Close button both close it, and focus goes back to the card
- Tab stays inside the dialog while it's open
- The dialog has
aria-modal="true"and is labelled with the platform name - Mouse use works as before, including closing by clicking the backdrop
-
npm run check,npm run testandnpm run buildpass - The PR says how you tested it with the keyboard
Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #170 in the description.
- 主要语言
- TypeScript
- 星标
- 8
- 派生
- 4
- 平均合并
- 5 小时 44 分钟
- 30 天内合并 PR
- 83
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
codercops/ogcops 的其他 Issue
-
Add the Order Status e-commerce template (`ecommerce-order-status`)可能已有人在做 @piyusshhjangid 今天认领。 未关闭good first issue hacktoberfest templates
codercops/ogcops#181 · 4 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Add the Cheat Sheet tutorial template (`tutorial-cheat-sheet`)可能已有人在做 @srikar-naidu 今天认领。 未关闭hacktoberfest help wanted templates
难度 2/5 1-3 小时 新手友好度 45/100
codercops/ogcops#180 · 3 条评论 ·
维护者通常 1 天内回复
-
Add the Call for Speakers event template (`event-call-for-speakers`)可能已有人在做 @Saifjafri212213 今天认领。 未关闭good first issue hacktoberfest templates
codercops/ogcops#177 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Add the Day Streak developer template (`developer-day-streak`)可能已有人在做 @srikar-naidu 今天认领。 未关闭hacktoberfest help wanted templates
codercops/ogcops#176 · 3 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
hacktoberfest
难度 1/5 1 小时以内 新手友好度 35/100
维护者通常 1 天内回复
相似的 Issue
-
createAI: the ai peer range allows ai@6, which the provider cannot work with可能已有人在做 @akhil9tiet 今天认领。 未关闭bug
难度 1/5 1 小时以内 新手友好度 83/100
cloudflare/agents#2690 · 3 条评论 ·
维护者通常 1 天内回复
-
[fullsend] E2E: theme — global-header ignores app.branding.fullLogo (RHDHBUGS-3670)可能已有人在做 @fullsend-ai-coder 今天认领。 未关闭e2e-failure ready-to-code
难度 1/5 1 小时以内 新手友好度 78/100
redhat-developer/rhdh-plugin-export-overlays#4503 · 1 条评论 ·
维护者通常 1 天内回复
-
needs triage 📥
难度 1/5 1 小时以内 新手友好度 86/100
ethereum/ethereum-org-website#19601 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
cloudscape-design/components#5184 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
agilepathway/label-checker#805 ·
维护者通常 1 天内回复