Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Material UI AutoComplete dropdown position

how to disable autocomplete auto position?

want to show autocomplete options always bottom.

https://codesandbox.io/s/material-demo-forked-t1luy?file=/demo.js

like image 915
Rahul Shah Avatar asked Jun 11 '26 23:06

Rahul Shah


1 Answers

Add popper props with modifiers:

<Autocomplete
  id="combo-box-demo"
  options={top100Films}

  /* ...yourProps */

  componentsProps={{
    popper: {
      modifiers: [
        {
          name: 'flip',
          enabled: false
        },
        {
           name: 'preventOverflow',
           enabled: false
         }
      ]
    }
  }}

  renderInput={(params) => (
    <TextField {...params} label="Combo box" variant="outlined" />
  )}
/>
like image 152
Olga Solomonenko Avatar answered Jun 14 '26 11:06

Olga Solomonenko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!