Skip to content

[react] Use floating document for virtual arrow - #4662

Merged
atomiks merged 1 commit into
mui:masterfrom
lyzno1:codex/floating-arrow-owner-document
Apr 22, 2026
Merged

atomiks merged 1 commit into
mui:masterfrom
lyzno1:codex/floating-arrow-owner-document

Conversation

@lyzno1

@lyzno1 lyzno1 commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • create the virtual arrow element from the floating element's owner document

Why

When no arrow element is mounted, the fallback element should use the same document as the positioned floating element instead of falling back through a null arrow ref.

Checks

  • pnpm typescript
  • pnpm eslint packages/react/src/utils/useAnchorPositioning.ts
  • pnpm prettier --check packages/react/src/utils/useAnchorPositioning.ts

@pkg-pr-new

pkg-pr-new Bot commented Apr 22, 2026

Copy link
Copy Markdown
  • base-ui-tanstack-start

  • vite-css-base-ui-example

    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/react@4662
    
    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/utils@4662
    

commit: 242b362

@code-infra-dashboard

code-infra-dashboard Bot commented Apr 22, 2026 •

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 🔺+9B(0.00%) ▼-2B(0.00%)

Details of bundle changes

Performance

Total duration: 1,098.08 ms ▼-171.41 ms(-13.5%) | Renders: 53 (+0) | Paint: 1,677.83 ms ▼-296.76 ms(-15.0%)

Test Duration Renders
Tooltip mount (300 contained roots) 58.27 ms 🔺+2.20 ms(+3.9%) 2 (+0)
Tabs mount (200 instances) 201.05 ms ▼-33.74 ms(-14.4%) 4 (+0)
Menu mount (300 instances) 119.00 ms ▼-25.29 ms(-17.5%) 2 (+0)
Select mount (200 instances) 125.75 ms ▼-24.14 ms(-16.1%) 3 (+0)
Mixed surface mount (app-like density) 82.35 ms ▼-18.97 ms(-18.7%) 5 (+0)

...and 7 more. View full report

Details of benchmark changes


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

@netlify

netlify Bot commented Apr 22, 2026

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 242b362
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/69e84f50c8d8a80008116c7c
😎 Deploy Preview https://deploy-preview-4662--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@lyzno1
lyzno1 marked this pull request as ready for review April 22, 2026 05:39
@atomiks atomiks added type: bug It doesn't behave as expected. scope: all components Widespread work has an impact on almost all components. labels Apr 22, 2026
@atomiks

atomiks commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Thanks for the contribution @lyzno1

@atomiks
atomiks merged commit 1f91154 into mui:master Apr 22, 2026
7 of 8 checks passed
@lyzno1
lyzno1 deleted the codex/floating-arrow-owner-document branch April 22, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: all components Widespread work has an impact on almost all components. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants