Inconsistent behavior with closeMenuOnSelect property when using Async
See original GitHub issueAre you asking a question?
No, I have make a question on Stack Overflow, but now i think it is an issue. https://stackoverflow.com/questions/52243760/retain-input-value-on-option-selected-in-react-select
Are you reporting a bug or runtime error?
Yes, I have created a demo for demonstrating this issue: https://codesandbox.io/s/345rp0m041
Reproduce steps:
-
type “a” and select one value Expected behavior: since the input value isn’t changed, the user should be able to select another option. Real behavior: the menu list show no option.
-
Enable this line to see it work as expected:
//import Select from "react-select";
So, I think we might have a inconsistent behavior between select
and async
component.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:11 (1 by maintainers)
Top Results From Across the Web
Angular async pipe and object property - Stack Overflow
I need to use async pipe without ngFor. I need to check property of object that is async loaded with observable. This is...
Read more >AsyncPipe - Angular
The async pipe subscribes to an Observable or Promise and returns the latest value it has emitted. ... It's also possible to use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Seeing the same thing. Unclear whether closeMenuOnSelect is intended to work with Async, but it does seem useful. Perhaps even more useful for Async when isMulti is used.
Use case: A user types into the input, sees 2 options they want to select, selects one of them… and then the input clears, and they have to type the same search term again to be able to select the second option.
Regardless of whether the dropdown stays open after select, it’s not useful unless you have the ability to persist options after selection (perhaps have an option not to clear the input value until the component is blurred?)
Whilst I’m probably going to use the workaround you’ve described @ebonow, I’m not sure I’d consider this ‘closed’ as closeMenuOnSelect is effectively ignored for AsyncSelect.
To me at least, closeMenuOnSelect should either be removed from the async version or this should be fixed internally (preferably) to give the same DX as the non-async version.