-
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
Automatically close react-select menu once the last item has been selected, instead of showing "No record" #3936
Comments
Is this issue free to work on ? |
I don't know, I guess nobody's working on it, but I don't know what's the process of contributing to react-select. See https://github.com/JedWatson/react-select/blob/master/CONTRIBUTING.md I guess one of the main contributor should give a go before any actual development. |
Hey @Vadorequest, Something like this should work — We don't want to auto close the options menu even if all options are selected 'cos the prop |
Hey @Vadorequest, I'm closing this issue now as this is possible with the APIs exposed. If you have further questions, feel free to reopen it. |
Hello, I have a further question, thanks. How to recreate the current functionality. I mean, there are a few snippets on how to control the menu via menuIsOpen, but following them means losing the built-in functionality (for that I mean the events that open and close the menu by default). I'd be happy if I could tell Select something on the likes of "by the way, keeping your current functionality, please also close the menu if the user scrolls past some point" or "please also, open this menu if the required prop is passed in and no selection was yet done". But I'd be content enough to know on what events should I close the panel, to recreate the current functionality, so I can append to it. |
I use the option
closeMenuOnSelect={false}
so that I can keep selecting choice (no menu close between them), but there is no need to keep it displayed with a "No item" message once I've selected all of them, I'd like it to close automatically.The user knows they've selected the last available item because they had the list visible and picked the last choice, there is no point displaying that message, which needs to click elsewhere to close the menu (extra useless action required).
The "No record" message should therefore only be displayed when we click again on the select, but not when we select the last item available.
This could either become an automatic behaviour when using
closeMenuOnSelect={false}
, or another option to keep the existing behaviour identical by default.I first tried to ask if such option was available, but it doesn't seem so https://stackoverflow.com/questions/60138160/how-to-automatically-close-react-select-menu-once-the-last-item-has-been-selecte/60229941?noredirect=1#comment106538897_60229941
The text was updated successfully, but these errors were encountered: