mui / mui/material-ui

Autocomplete input causes view jump when selecting a long option on Android

Open
#45,939 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

external dependency scope: autocomplete
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

Steps to reproduce
  1. Use an Android device to open this link to a live example: https://react-tkbu89tn.stackblitz.io

  2. Tap on the Autocomplete input.

  3. Select a very long option from the list.

  4. 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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.