Skip to content

[internal] Remove dead floating-ui-react focus-management code#5032

Draft
atomiks wants to merge 1 commit into
mui:masterfrom
atomiks:internal/remove-dead-focus-code
Draft

[internal] Remove dead floating-ui-react focus-management code#5032
atomiks wants to merge 1 commit into
mui:masterfrom
atomiks:internal/remove-dead-focus-code

Conversation

@atomiks

@atomiks atomiks commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Dead-code removal + comment fixes in floating-ui-react:

  • Remove the never-passed renderGuards prop from FloatingPortal.
  • Remove the dead triggers.hasElement check — it's subsumed by the following contains(trigger, relatedTarget) (true for parent === child, false for null).
  • Fix several stale/misleading internal comments, including the outside-press return-focus comment (the old "always ignore returnFocus" wording was inaccurate — focus is returned only when focus({ preventScroll }) is supported).

An earlier revision of this PR also dropped the focus({ preventScroll }) feature-detection as dead code. That was reverted: per caniuse, Chrome for Android and Samsung Internet (both in .browserslistrc) still don't support preventScroll (chromium#41453122), so removing the detection would scroll the page when focus is restored on outside-press.

@atomiks atomiks added type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. internal Behind-the-scenes enhancement. Formerly called “core”. labels Jun 12, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jun 12, 2026

Copy link
Copy Markdown

commit: 8283d26

@code-infra-dashboard

code-infra-dashboard Bot commented Jun 12, 2026

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react ▼-63B(-0.01%) ▼-21B(-0.01%)

Details of bundle changes

Performance

Total duration: 1,267.42 ms -186.82 ms(-12.8%) | Renders: 50 (+0) | Paint: 1,906.01 ms -278.38 ms(-12.7%)

Test Duration Renders
Checkbox mount (500 instances) 71.91 ms ▼-42.19 ms(-37.0%) 1 (+0)
Popover mount (300 instances) 61.43 ms ▼-16.09 ms(-20.8%) 1 (+0)

10 tests within noise — details


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

@netlify

netlify Bot commented Jun 12, 2026

Copy link
Copy Markdown

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 8aa000d
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6a2bb56963dd3a00081fdc10
😎 Deploy Preview https://deploy-preview-5032--base-ui.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.

@atomiks atomiks force-pushed the internal/remove-dead-focus-code branch from 2c104cf to 8283d26 Compare June 12, 2026 07:22
- Remove the never-passed renderGuards prop from FloatingPortal (S3).
- Remove the dead triggers.hasElement check subsumed by contains() (S6).
- Fix stale/misleading internal comments, including the inaccurate outside-press
  return-focus comment (return focus is allowed only when focus({ preventScroll })
  is supported, not 'always ignored').
@atomiks atomiks force-pushed the internal/remove-dead-focus-code branch from 8283d26 to 8aa000d Compare June 12, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Behind-the-scenes enhancement. Formerly called “core”. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant