Skip to content

[dialog] Fix unwanted DialogPaper focus ring#48535

Merged
mj12albert merged 2 commits into
mui:masterfrom
mj12albert:fix-dialog-paper-focus-ring
May 14, 2026
Merged

[dialog] Fix unwanted DialogPaper focus ring#48535
mj12albert merged 2 commits into
mui:masterfrom
mj12albert:fix-dialog-paper-focus-ring

Conversation

@mj12albert
Copy link
Copy Markdown
Member

@mj12albert mj12albert commented May 13, 2026

Preview: https://stackblitz.com/edit/cxdgcqan-xwxuwosp?file=package.json

The issue was that if no dialog content/children took focus (most docs demos set autoFocus on some content) the Paper itself would retain focus which triggered browser :focus-visible styles.

Reported for v7.x but also happens with v9.x

Fixes #48531

@mj12albert mj12albert added type: bug It doesn't behave as expected. scope: dialog Changes related to the dialog. v7.x needs cherry-pick The PR should be cherry-picked to master after merge. labels May 13, 2026
@code-infra-dashboard
Copy link
Copy Markdown

code-infra-dashboard Bot commented May 13, 2026

Deploy preview

https://deploy-preview-48535--material-ui.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/material 🔺+10B(0.00%) 🔺+4B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@mj12albert mj12albert marked this pull request as ready for review May 13, 2026 13:54
@ZeeshanTamboli
Copy link
Copy Markdown
Member

ZeeshanTamboli commented May 14, 2026

Is it caused because of #48280?

@mj12albert
Copy link
Copy Markdown
Member Author

Is it caused because of #48280?

Yeah it added tabIndex -1 to dialog's paper which is programmatically focusable

@mj12albert mj12albert enabled auto-merge (squash) May 14, 2026 11:27
@mj12albert mj12albert merged commit 1da63f5 into mui:master May 14, 2026
18 checks passed
@github-actions
Copy link
Copy Markdown

Cherry-pick PRs will be created targeting branches: v7.x

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

Labels

needs cherry-pick The PR should be cherry-picked to master after merge. scope: dialog Changes related to the dialog. type: bug It doesn't behave as expected. v7.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[dialog] Focus ring on dialog paper on first load

2 participants