I am using React.js and I want to autoscroll to a certain item in the dropdown, after clicking on the dropdown. The item I want to auto scroll to is somewhere in the middle, how is this achievable ?
Am using an Autocomplete of material-ui and React.js
for example I have the following values in the dropdown list :
const top100Films = [
{ label: 'The Shawshank Redemption', year: 1994 },
{ label: 'The Godfather', year: 1972 },
{ label: 'The Godfather: Part II', year: 1974 },
{ label: 'The Dark Knight', year: 2008 },
{ label: '12 Angry Men', year: 1957 },
{ label: "Schindler's List", year: 1993 },
{ label: 'Pulp Fiction', year: 1994 }
]
I want when I tap on the dropdown, the list auto-scrolls to item :
{ label: 'The Dark Knight', year: 2008 },
How can this be achievable ?