salesforce / salesforce/design-system-react

Modal: Focus close button on open. Fallback to wrapping container div if no close button

Open
#2,018 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

accessibility modal
Dominant language
JavaScript
Stars
982
Forks
440
Avg merge
1d 21h
Merged PRs (30d)
4

Description

https://design-system-react-co-pr-2004.herokuapp.com/?selectedKind=SLDSModal&selectedStory=Modal%20with%20Custom%20Parent%20Node&full=0&addons=1&stories=1&panelRight=0&addonPanel=storybook%2Factions%2Factions-panel

Issue: Screen readers read all lines of text as "clickable", sometimes reading multiple "clickable" before reading the content

Potential cause: Most likely a click handler is higher in the DOM (maybe the close button?) and everything inside this becomes clickable as well.

Possible solutions: Is it possible to wrap the click event in a clickable event that is not the parent for the other child elements that are reading as clickable? Please see this (older) WebAIM thread that has a long discussion of this type of issue for other potential solutions (https://webaim.org/discussion/mail_thread?thread=7693)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked SLDSModal reproduction, especially the “Modal with Custom Parent Node” story, and inspect the Modal implementation and its focus behavior. Verify how screen readers announce the modal when it opens with and without a close button; done means focus reaches the close button when present and otherwise falls back to the wrapping container without child content being announced as clickable.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
accessibility, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.