Skip to content

🎨 Palette: [UX improvement] Enhance Dialog component accessibility#222

Open
ivanleekk wants to merge 1 commit into
devfrom
palette/dialog-a11y-5307551743830549429
Open

🎨 Palette: [UX improvement] Enhance Dialog component accessibility#222
ivanleekk wants to merge 1 commit into
devfrom
palette/dialog-a11y-5307551743830549429

Conversation

@ivanleekk

Copy link
Copy Markdown
Owner

💡 What

Added essential ARIA attributes and focus styles to the Dialog component to improve its accessibility.

  • The backdrop now has aria-hidden="true".
  • The modal container now has role="dialog" and aria-modal="true".
  • The icon-only close button now has an aria-label="Close dialog" and focus-visible styles for better keyboard navigation.

🎯 Why

Dialogs are critical UI elements that require proper ARIA attributes to be announced correctly by screen readers. Without these attributes, screen reader users might not realize a modal has opened or be able to easily find the close button. Furthermore, icon-only buttons always need an aria-label for assistive technologies. Adding focus-visible ensures that users navigating via keyboard can clearly see when the close button has focus.

📸 Before/After

(Visuals remain unchanged for standard pointer interactions, but keyboard focus ring is now visible on the close button, and screen reader announcements are significantly improved.)

♿ Accessibility

  • Screen readers will now correctly identify the component as a modal dialog and trap context appropriately.
  • The close button is now properly labeled for screen readers.
  • Keyboard navigation is improved with a clear focus ring on the close button.

PR created automatically by Jules for task 5307551743830549429 started by @ivanleekk

- Added `role="dialog"` and `aria-modal="true"` to modal container
- Added `aria-hidden="true"` to backdrop
- Added `aria-label="Close dialog"` and `focus-visible` styles to close button

Co-authored-by: ivanleekk <84584280+ivanleekk@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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.

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