Skip to content

[autocomplete] Jumps between being expanded to the top/bottom #21661

Description

@foxylion
  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

When having not that much space below the bottom of the input field the Autocomplete opens to the top.
By entering text into the input field the Autocomplete field gets shorter and jumps to the bottom.

Expected Behavior 🤔

After opening the Autocomplete ist should stay at the same position as the switch to the bottom is not expected and the user has to re-orientate to find the list of suggestions.

Steps to Reproduce 🕹

Reproducible in the docs demo: https://mui.com/material-ui/react-autocomplete/#combo-box

  1. Open the popup when the component is near the bottom edge of the viewport(leave a gap roughly the size of one option). It should open to the top of the textbox.
  2. Filter the options until there is one left (e.g. type "Shawshank redemption")
  3. Popup shifts to the bottom (popper's flip middleware kicks in)

(Stale) CodeSandbox used for reproduction: https://codesandbox.io/s/naughty-hermann-24rmn

Steps:

  1. The input field
    image
  2. Ensure that there is not much space to the bottom
  3. After clicking into the field, the Autocomplete opens to the top (as expected ✔️)
    image
  4. After typing an "a", the Autocomplete jumps to the bottom (not expected, should stay ❌)
    image

Your Environment 🌎

Tech Version
Material-UI v4.11.0
React v16.13.1
Browser Chrome 83

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: autocompleteChanges related to the autocomplete. This includes ComboBox.type: enhancementIt’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions