patternfly / patternfly/patternfly-react

Modal default focus prioritizes close button over content elements

Open
#11,956 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Stale
Dominant language
TypeScript
Stars
862
Forks
392
Avg merge
4d 8h
Merged PRs (30d)
9

Description

When a Modal opens, focus currently defaults to the close (X) button in the header, regardless of what interactive elements exist within the modal content. This behavior is a bit counterintuitive. The default focus should prioritize the first meaningful, focusable element within the modal body (e.g., a primary action button) rather than header controls.

This request originates from a Red Hat product team. There is no hard deadline.


Jira Issue: PF-2526

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 by locating the Modal implementation and its existing focus-management tests, then reproduce the default focus behavior with interactive content in the modal body. Done means focus prioritizes the first meaningful focusable body element over the header close button while preserving expected modal focus behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
accessibility, frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.