🎨 Palette: Add role="region" to scrollable areas for screen readers#112
🎨 Palette: Add role="region" to scrollable areas for screen readers#112lavkushry wants to merge 1 commit into
Conversation
Adds the missing `role="region"` attribute to `.visual-figure__body` and generic scrollable code `<pre>` tags in `theme/visual-edition.js`. This prevents screen readers from silently ignoring the `aria-label` applied to these elements. Co-authored-by: lavkushry <106930153+lavkushry@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 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 |
💡 What
Added
role="region"alongside the existingaria-labelassignments for.visual-figure__bodyand<pre>elements when they are made horizontally scrollable via JavaScript intheme/visual-edition.js.🎯 Why
When generic container elements (like
<div>or<pre>) are giventabIndex="0"and anaria-labelto provide keyboard accessibility for scrolling, screen readers (like VoiceOver or NVDA) will often ignore the label entirely because the element has no semantic meaning. By giving these generic elements an explicitrole="region", we tell the screen reader to treat the element as a distinct section of the page, causing it to properly announce thearia-labelwhen the user focuses it.📸 Before/After
tabIndex=0andaria-labelon generic elements without a semantic role.role="region"to properly identify them as labeled scrollable areas. (No visual changes, purely structural/semantic DOM updates).♿ Accessibility
Fixes an accessibility anti-pattern where a helpful
aria-labelmeant to assist keyboard users in identifying a scrollable area ("Scrollable diagram region" or "Scrollable Rust code sample") was ignored by assistive technology. Screen readers will now announce these regions successfully.PR created automatically by Jules for task 13808635171479012360 started by @lavkushry