-
-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using scrollTo method of the dropdown list (menu) in the OptionList component #1003
Comments
The answer is the same as ant-design/ant-design#46401 (comment) In addition, this repo is also maintained by |
@yoyo837 It's great that you can also advise on antd here! |
Hi, I have the following problem with OptionList. I am using the AutoComplete component in the antd library.
The dropdown list uses the optionList from rc-select. I need to scroll to the selected item in the input field when opening the dropdown list.
To do this, I use the useEffect hook when rendering the menu (RenderDropdownMenu), where I access the menu and call scrollTo to the desired index. But the hook is triggered every time the menu is rendered and returns to the selected item.
What can be done about it?
Reproduction:
https://codesandbox.io/p/sandbox/selectscrollto-29x7sc?file=%2Fdemo.tsx%3A130%2C20
antd developers couldn't help
thanks
The text was updated successfully, but these errors were encountered: