当我打开select时,菜单项容器将滚动到选定项。如何避免滚动到所选项目?
<FormControl fullWidth style={{ marginTop: 100 }}>
<InputLabel>Age</InputLabel>
<Select
value={age}
onChange={event => setAge(event.target.value)}
MenuProps={{
MenuListProps: {
style: {
maxHeight: 300
}
}
}}
>
{options.map(option => {
return <MenuItem value={option.value}>{option.label}</MenuItem>;
})}
</Select>
</FormControl>