Skip to content

fix: prevent loading overlay from stealing focus - #23152

Open
adamalston wants to merge 2 commits into
carbon-design-system:mainfrom
adamalston:n/a-loading
Open

fix: prevent loading overlay from stealing focus#23152
adamalston wants to merge 2 commits into
carbon-design-system:mainfrom
adamalston:n/a-loading

Conversation

@adamalston

@adamalston adamalston commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

No issue. Related to #22196

Prevented active loading overlays from stealing focus from already focused page controls during navigation. Also prevented loading overlays behind modals from exposing a second modal dialog to assistive tech.

Changelog

Changed

  • Prevented active loading overlays from stealing focus from an already focused page control during navigation.
  • Removed aria-modal="true" from loading dialogs to avoid conflicting modal semantics when a loading overlay appears behind a modal.

Testing / Reviewing

These changes fix the unexpected focus behavior introduced by 5d916f1, which may be considered a regression. I noticed issues after updating Carbon in one of the products I work on and seeing unexpected behavior related to Loading components.

Loading overlays should only claim focus when the document is focused on body.

Focus a page control, activate a Loading component with withOverlay, and verify that focus remains on the page control. Verify that focus trapping still works when focus moves outside the active overlay.

PR Checklist

As the author of this PR, before marking ready for review, confirm you:

  • Reviewed every line of the diff
  • Updated documentation and storybook examples
  • Followed the
    required v12 migration documentation
    for any code change that affects v12, or struck through this item because
    the PR does not affect v12
  • Wrote passing tests that cover this change
  • Addressed any impact on accessibility (a11y)
  • Tested for cross-browser consistency
  • Validated that this code is ready for review and status checks should pass

More details can be found in the pull request guide

@adamalston
adamalston requested a review from a team as a code owner August 27, 2026 21:22
@netlify

netlify Bot commented Aug 27, 2026

Copy link
Copy Markdown

Deploy Preview for v12-carbon-react ready!

Name Link
🔨 Latest commit 00fd76c
🔍 Latest deploy log https://app.netlify.com/projects/v12-carbon-react/deploys/6a90b7b8925f7e0008af21cd
😎 Deploy Preview https://deploy-preview-23152--v12-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 27, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit 00fd76c
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/6a90b7b8925f7e0008af21cb
😎 Deploy Preview https://deploy-preview-23152--v11-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 27, 2026

Copy link
Copy Markdown

Deploy Preview for v12-carbon-web-components ready!

Name Link
🔨 Latest commit 00fd76c
🔍 Latest deploy log https://app.netlify.com/projects/v12-carbon-web-components/deploys/6a90b7b8eb00b700084f5f35
😎 Deploy Preview https://deploy-preview-23152--v12-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 27, 2026

Copy link
Copy Markdown

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 00fd76c
🔍 Latest deploy log https://app.netlify.com/projects/carbon-elements/deploys/6a90b7b8925f7e0008af21c5
😎 Deploy Preview https://deploy-preview-23152--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 27, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 00fd76c
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/6a90b7b800aa240008304bf0
😎 Deploy Preview https://deploy-preview-23152--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.65%. Comparing base (7bd6bbb) to head (00fd76c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #23152      +/-   ##
==========================================
- Coverage   89.67%   89.65%   -0.02%     
==========================================
  Files         639      639              
  Lines       58865    58866       +1     
  Branches     8334     8335       +1     
==========================================
- Hits        52785    52778       -7     
- Misses       5914     5922       +8     
  Partials      166      166              
Flag Coverage Δ
main-packages 87.15% <100.00%> (+<0.01%) ⬆️
web-components 90.52% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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