You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Select "value" in the dropdown
Try scroll down or up
antd developers couldn't help
thanks
The text was updated successfully, but these errors were encountered:
In addition, this repo is also maintained by antd members. :)
@yoyo837 It's great that you can also advise on antd here!
I understand that there is no answer to my comment, because AutoComplete was conceived exactly as it is now. But I need the label to be in the input field, not the value. I was offered to change the component to Select with the showSearch parameter. But his behavior doesn't suit me either. For my task, I am satisfied with AutoComplete, but I cannot cope with scrolling so that the selected element is displayed when opening. Maybe you can recommend something?
Thanks a lot
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: