React-admin: no scrollbar with AutocompleteInput

Created on 9 Oct 2018  路  2Comments  路  Source: marmelab/react-admin

Hello,
thank you for your project.
An annoying bug exists with AutocompleteInput. There is no scrollbar and it takes the entire length of the screen. This is most visible when there is a lot of data.

<ReferenceInput
   label="Institut"
   source="main_institute"
   reference="institutes"
   perPage={250}
>
   <AutocompleteInput optionText="name" />
</ReferenceInput>

image 2

Environment

  • React-admin version: 2.3.3
  • React version: 16.5.2
  • Browser: chrome 69
bug

Most helpful comment

One solution(hack actually) is to override this on themes like that:

MuiPaper: {
      elevation2: {
        '& ul[role=listbox]': {
           maxHeight: '250px',
           overflowY: 'auto',
        }
      }
    }

All 2 comments

In 'admin-on-rest' one could achieve this functionality by passing menuProps: { maxHeight: 280 } to the options prop on AutocompleteInput to get a scrollbar to appear. I have not figured out how to do this in the current version, or if it is possible via the props, yet. My interim solution is requesting a small set of items in these components but I would love to get the scrollbar back in there.

One solution(hack actually) is to override this on themes like that:

MuiPaper: {
      elevation2: {
        '& ul[role=listbox]': {
           maxHeight: '250px',
           overflowY: 'auto',
        }
      }
    }
Was this page helpful?
0 / 5 - 0 ratings

Related issues

9747749366 picture 9747749366  路  3Comments

samanmohamadi picture samanmohamadi  路  3Comments

nicgirault picture nicgirault  路  3Comments

waynebloss picture waynebloss  路  3Comments

ericwb picture ericwb  路  3Comments