Autocomplete input causes view jump when selecting a long option on Android
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 99.1k
- Forks
- 32.5k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 106
Description
Steps to reproduce
-
Use an Android device to open this link to a live example: https://react-tkbu89tn.stackblitz.io
-
Tap on the Autocomplete input.
-
Select a very long option from the list.
-
Observe that after selection, the Card (or scrollable container) jumps to the right unexpectedly.
Current behavior
When using Autocomplete inside a horizontally scrollable container (like a Card with overflow-x: auto), selecting an option that has a long label causes the container to jump/scroll horizontally, even though the TextField has a fixed width and is styled correctly (overflow: hidden, text-overflow: ellipsis).
As a result, the user experience feels broken: after selecting an option, the view suddenly shifts, and part of the content may get hidden off-screen.
This behavior happens only on Android devices.
Link to StackBlitz: https://stackblitz.com/edit/react-tkbu89tn?file=Demo.js
Expected behavior
- The selected value should appear inside the input field.
- The input field should remain in the same visual position after selection.
- No horizontal scroll or view jump should happen automatically (as it correctly behaves on non-Android devices).
Context
No response
Your environment
Search keywords: component: autocomplete
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.
Research direction
Start with the linked StackBlitz example and its Demo.js file, then reproduce the selection flow on an Android device inside the horizontally scrollable Card. Trace the Autocomplete selection behavior and verify that choosing a long option leaves the input in place without horizontal scrolling or a view jump.
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
- Mostly clear
- Newbie friendliness
- 48/100