-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
the selected value is not the first displayed #4368
Comments
Greetings @alexandrebouttier , The default behavior now is such that the selected item is scrolled so that it is the bottom most item. I don't know if/when this changed nor do I know any rationale for this. However, here is a solution I created in response to #4305 Demo: codesandbox Please let me know if this resolves your use-case. |
Thank you @ebonow for your solution it worked for me SOLUTION by @ebonow :
|
This solution works perfectly for single select value, what if we are using isMulti=true, in case of Multi select what changes do we need to make? |
Looks like So in the posted solution, const onMenuOpen = () => {
setTimeout(() => {
const { focusedOptionRef } = selectRef.current;
focusedOptionRef &&
focusedOptionRef.scrollIntoView({ behavior: "smooth" });
}, 1);
}; |
Hello, I have a little problem I have several options in my select, and I would like the value to be selected to be scrolled directly to the top to be the first of the options
it works with an old version 1.0.0-rc.2, following the migration to 3.1.1 it no longer works
The text was updated successfully, but these errors were encountered: