gpt4 book ai didi

reactjs - react-select 不会自动滚动到所选选项

转载 作者:行者123 更新时间:2023-12-05 07:17:59 29 4
gpt4 key购买 nike

如何使用 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}
/>

最佳答案

你可以使用 react-select 属性,

      menuShouldScrollIntoView={true}

谢谢。

关于reactjs - react-select 不会自动滚动到所选选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58526700/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com