[DataGrid] Fix scrollbars not showing up on scroll on iOS#22832
Conversation
Deploy previewBundle size
Check out the code infra dashboard for more information about this PR. |
There was a problem hiding this comment.
⚠️ Not ready to approve
iOS-specific styling is baked into styled() at module init, which can cause SSR/client hydration className mismatches on iOS.
Pull request overview
This PR addresses iOS-specific scrollbar visibility in the Data Grid virtual scroller by swapping from the grid’s virtual scrollbars to the native scroller scrollbars on iOS, based on new platform detection utilities in @mui/x-internals.
Changes:
- Added iOS platform detection (
isIOS) to@mui/x-internals/platform, including iPadOS 13+ disambiguation viamaxTouchPoints. - Updated
GridVirtualScrollerto show native scrollbars on iOS while keeping them hidden elsewhere. - Updated
GridVirtualScrollbarto hide the virtual scrollbar UI on iOS to avoid duplicate thumbs.
File summaries
| File | Description |
|---|---|
| packages/x-internals/src/platform/shared.ts | Adds normalized navigator reads (SSR-safe fallbacks) for platform/UA/touch points. |
| packages/x-internals/src/platform/index.ts | Introduces isIOS export using normalized platform/touch-point data. |
| packages/x-data-grid/src/components/virtualization/GridVirtualScroller.tsx | Enables native scroller scrollbars on iOS via conditional scrollbar styling. |
| packages/x-data-grid/src/components/virtualization/GridVirtualScrollbar.tsx | Hides virtual scrollbar on iOS to prevent duplicate scrollbar thumbs. |
Copilot's findings
- Files reviewed: 4/4 changed files
- Comments generated: 3
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
⚠️ Not ready to approve
The new SSR hydration test currently bypasses fail-on-console behavior but does not fail on non-hydration console errors, which can mask real regressions.
Copilot's findings
- Files reviewed: 4/4 changed files
- Comments generated: 2
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
arminmeh
left a comment
There was a problem hiding this comment.
Looks fine, but I didn't do the test on the actual device.
|
@arminmeh BTW, do scrollbars work fine on Android? Would be great to double check. |
Android remained unchanged |
Unchanged meaning "scrollbars show up on scroll"? 😅 |
Haha, yes |
|
Cherry-pick PRs will be created targeting branches: v8.x |
Fixes #22386
The solution is based on #22386 (comment)
Preview: https://deploy-preview-22832--material-ui-x.netlify.app/x/react-data-grid/#pro-version
Screen.Recording.2026-06-18.at.11.48.25.mov