mui / mui/material-ui

[autocomplete] Popup causes undesirable page scroll on mobile

Open
#46,791 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

mobile scope: autocomplete scope: drawer type: bug
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

Steps to reproduce

Steps:

  1. Open this link to live example: https://codesandbox.io/p/devbox/dreamy-jerry-x84wzk
  2. Click the Filter button to toggle the Drawer
  3. Ensure that scrolling on the drawer does not move the document body
  4. Click into one of the Autocomplete component
  5. Scrolling anywhere on the screen scrolls the entire document

https://github.com/user-attachments/assets/6483dce9-d513-4b52-8d3d-09dba73808df

I first encountered this issue in v5, but am able to reproduce it in v7 as well - https://codesandbox.io/p/sandbox/react-hook-form-mui-5-v7-controller-ts-10d64d

Current behavior

The entire document scrolls.

Expected behavior

Only the drawer/autocomplete should scroll.

Context

No response

Your environment
npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: drawer, autocomplete

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the problem using the linked CodeSandbox examples, focusing on the interaction between the Drawer and Autocomplete on mobile. Trace the scroll behavior from those components and verify the fix by confirming that scrolling within the Autocomplete or Drawer no longer scrolls the document body.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.