Skip to content

🎨 Palette: Make scrollable output regions keyboard accessible#3521

Draft
EffortlessSteven wants to merge 1 commit intomainfrom
palette/a11y-scrollable-regions-11126914773992388177
Draft

🎨 Palette: Make scrollable output regions keyboard accessible#3521
EffortlessSteven wants to merge 1 commit intomainfrom
palette/a11y-scrollable-regions-11126914773992388177

Conversation

@EffortlessSteven
Copy link
Copy Markdown
Member

💡 What
Converted invalid <label> tags wrapping non-interactive output regions into styled divs with ids, and added tabindex="0", role="region", and aria-labelledby to the scrollable output containers across browser WASM examples.

🎯 Why
Using <label> for non-form controls is invalid HTML. More importantly, the output divs use overflow-y: auto, meaning their content can scroll. Without tabindex="0", keyboard-only users cannot focus the region to scroll it using arrow keys, making long outputs inaccessible.

📸 Before/After
Before: Output regions were unfocusable by keyboard, and used invalid <label> tags.
After: Output regions can receive keyboard focus to allow scrolling, and use valid ARIA labelling semantics for screen readers.

♿ Accessibility

  • Fixed invalid HTML structure (removed <label> for non-form elements).
  • Added tabindex="0" to allow keyboard navigation and scrolling of overflowing content.
  • Added role="region" and aria-labelledby to properly announce the region's purpose to screen reader users.

PR created automatically by Jules for task 11126914773992388177 started by @EffortlessSteven

@google-labs-jules
Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 14, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ef706f06-d0f3-41ce-881e-4d40ef56e811

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch palette/a11y-scrollable-regions-11126914773992388177

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request improves the accessibility of scrollable output regions in the browser examples by replacing invalid tags with styled

elements and adding role="region" with tabindex="0". Feedback was provided regarding the .streaming-output containers, which lack a max-height constraint; without this, the containers will not scroll internally, making the added tabindex="0" redundant and potentially confusing for keyboard users.

<label>Streaming Output:</label>
<div id="streaming-output" class="streaming-output">Streaming output will appear here...</div>
<div style="font-weight: 500; margin-bottom: 5px;" id="streaming-output-label">Streaming Output:</div>
<div id="streaming-output" class="streaming-output" tabindex="0" role="region" aria-labelledby="streaming-output-label">Streaming output will appear here...</div>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The .streaming-output class (defined on line 167) lacks a max-height property, unlike the .output class. Without a height constraint, this container will grow vertically to fit its content rather than scrolling internally. As a result, tabindex="0" becomes a redundant tab stop for keyboard users because there is no overflowing content to scroll within the element itself. To fix this, you should add a max-height (e.g., 300px) to the .streaming-output CSS class or as an inline style to ensure the region is actually scrollable.

Suggested change
<div id="streaming-output" class="streaming-output" tabindex="0" role="region" aria-labelledby="streaming-output-label">Streaming output will appear here...</div>
<div id="streaming-output" class="streaming-output" tabindex="0" role="region" aria-labelledby="streaming-output-label" style="max-height: 300px;">Streaming output will appear here...</div>

<label>Streaming Output:</label>
<div id="streaming-output" class="streaming-output">Streaming output will appear here...</div>
<div style="font-weight: 500; margin-bottom: 5px;" id="streaming-output-label">Streaming Output:</div>
<div id="streaming-output" class="streaming-output" tabindex="0" role="region" aria-labelledby="streaming-output-label">Streaming output will appear here...</div>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The .streaming-output class (defined on line 157) lacks a max-height property. Without a height constraint, this container will expand to fit its content, meaning overflow-y: auto will not trigger an internal scrollbar. This makes the tabindex="0" attribute unnecessary and potentially confusing for keyboard users as the region won't actually be scrollable. Consider adding a max-height to the CSS class or as an inline style to ensure the region functions as an accessible scrollable area.

Suggested change
<div id="streaming-output" class="streaming-output" tabindex="0" role="region" aria-labelledby="streaming-output-label">Streaming output will appear here...</div>
<div id="streaming-output" class="streaming-output" tabindex="0" role="region" aria-labelledby="streaming-output-label" style="max-height: 300px;">Streaming output will appear here...</div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant