fix(youtube-player): a11y keyboard-accessible#798
Conversation
Adds tabindex, role=button, aria-label and Enter/Space key handling on the ScriptYouTubePlayer placeholder so keyboard users can load the video without a pointer. The keydown handler dispatches the configured trigger event on the root element so it flows through the existing useScriptTriggerElement listener. Closes #797
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
📝 WalkthroughWalkthrough
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔗 Linked issue
Resolves #797
❓ Type of change
📚 Description
ScriptYouTubePlayer's placeholder responds to mouse triggers but was not reachable by keyboard, so AT users could not load the video. While the placeholder is showing and the configured trigger is event-based (e.g.mousedown), the root element now getstabindex="0",role="button"andaria-label="Play video". AnonPlaceholderKeydownhandler dispatches the configured trigger event on the root for Enter/Space so the load path matches a click. Non-event triggers (immediate,onNuxtReady,visibility,visible) keep previous behaviour.