[material-ui][Menu] `disableScrollLock` doesn't work for Select when wrapper's overflow hidden
Open
Nobody has claimed this yet.
scope: menu
scope: select
- Dominant language
- JavaScript
- Stars
- 99.1k
- Forks
- 32.5k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 106
Description
Steps to reproduce
Link to live example: Sandbox example (Just click on the Select component)
Steps:
- Inside a component with
overflow = hiddencreate a Select using Select and MenuItem components - Make Select component
scrollIntoViewon focus - Observe that Menus get away from the Select component although
disableScrollLockshould stop it
Current behavior
The MenuItems get away from the select
I use overflow=hidden for the main parent component of my app, so there's nothing I can easily change
Expected behaviour
When disableScrollLock is true, MenuItems should always stick to the Select component, regardless of the style and properties of the parent components.
Context
No response
Your environment
I use Chrome Version 124, but same behaviour with Firefox and Safari
npx @mui/envinfo
System:
OS: macOS 14.4.1
Binaries:
Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm
pnpm: Not Found
Browsers:
Chrome: 125.0.6422.60
Edge: Not Found
Safari: 17.4.1
npmPackages:
@emotion/react: 11.11.1
@emotion/styled: 11.11.0
@mui/base: 5.0.0-beta.32
@mui/core-downloads-tracker: 5.15.5
@mui/icons-material: ^5.15.5 => 5.15.5
@mui/lab: ^5.0.0-alpha.165 => 5.0.0-alpha.165
@mui/material: ^5.15.5 => 5.15.5
@mui/private-theming: 5.15.5
@mui/styled-engine: 5.15.5
@mui/system: ^5.15.5 => 5.15.5
@mui/types: 7.2.13
@mui/utils: 5.14.18
@mui/x-data-grid: 6.18.7
@mui/x-data-grid-premium: ^6.18.7 => 6.18.7
@mui/x-data-grid-pro: 6.18.7
@mui/x-date-pickers: ^6.19.0 => 6.19.0
@mui/x-license-pro: ^6.10.2 => 6.10.2
@types/react: ^18.0.5 => 18.2.33
react: ^18.2.0 => 18.2.0
react-dom: ^18.2.0 => 18.2.0
styled-components: 5.3.11
typescript: ^5.4.5 => 5.4.5
Search keywords: disableScrollLock
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.