Skip to content

[composite] Fix scroll alignment for RTL direction in scrollIntoViewIfNeeded - #5234

Merged
sai6855 merged 5 commits into
mui:masterfrom
sai6855:rtl-bug
Jul 14, 2026
Merged

sai6855 merged 5 commits into
mui:masterfrom
sai6855:rtl-bug

Conversation

@sai6855

@sai6855 sai6855 commented Jul 14, 2026

Copy link
Copy Markdown
Member

This PR fixes an issue in scrollIntoViewIfNeeded where the RTL overflow check used scrollMarginRight while the scroll position calculation used scrollMarginLeft

@sai6855 sai6855 added type: bug It doesn't behave as expected. internal Behind-the-scenes enhancement. Formerly called “core”. labels Jul 14, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 14, 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@5234
    
    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/utils@5234
    

commit: 8068d8e

@code-infra-dashboard

code-infra-dashboard Bot commented Jul 14, 2026 •

Copy link
Copy Markdown

Bundle size

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

Details of bundle changes

Performance

Total duration: 1,423.85 ms +176.46 ms(+14.1%) | Renders: 78 (+0) | Paint: 2,204.42 ms +254.01 ms(+13.0%)

Test Duration Renders
Menu mount (300 instances) 146.46 ms 🔺+29.79 ms(+25.5%) 2 (+0)
Popover mount (300 instances) 76.30 ms 🔺+16.91 ms(+28.5%) 1 (+0)
Select open (500 options) 49.37 ms 🔺+8.70 ms(+21.4%) 14 (+0)

11 tests within noise — details

Metric alarms

Test Metric Change
Menu mount (300 instances) bench:paint 🔺 +42.64 ms
Popover mount (300 instances) bench:paint 🔺 +25.36 ms

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

@netlify

netlify Bot commented Jul 14, 2026

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Built without sensitive environment variables

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

@sai6855
sai6855 marked this pull request as ready for review July 14, 2026 07:32
@sai6855
sai6855 requested a review from atomiks as a code owner July 14, 2026 07:32
Copilot AI review requested due to automatic review settings July 14, 2026 07:32
@netlify

netlify Bot commented Jul 14, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Built without sensitive environment variables

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an RTL-specific scroll alignment bug in scrollIntoViewIfNeeded within the Composite internals, ensuring the overflow check uses the same scroll margin side as the subsequent scroll position calculation.

Changes:

  • Align RTL “overflow to the left” detection to use scrollMarginLeft, matching the computed targetX adjustment.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@atomiks atomiks changed the title [internal] Fix scroll alignment for RTL direction in scrollIntoViewIfNeeded [composite] Fix scroll alignment for RTL direction in scrollIntoViewIfNeeded Jul 14, 2026
@atomiks atomiks added scope: all components Widespread work has an impact on almost all components. and removed internal Behind-the-scenes enhancement. Formerly called “core”. labels Jul 14, 2026
@sai6855
sai6855 enabled auto-merge (squash) July 14, 2026 11:22
@sai6855
sai6855 merged commit d428301 into mui:master Jul 14, 2026
7 checks passed
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.

3 participants