如何使用react-select滚动到选定的选项?
<Select
matchProp='label'
classes={classes}
inputId="react-select-single"
TextFieldProps={{
InputLabelProps: {
htmlFor: 'react-select-single',
shrink: true,
},
disableUnderline: true
}}
options={options}
components={components}
value={single}
onChange={handleChangeSingle}
/>
答案 0 :(得分:1)
您可以使用 react-select 属性,
menuShouldScrollIntoView={true}
谢谢。