question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inconsistent behavior with closeMenuOnSelect property when using Async

See original GitHub issue

Are 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:

  1. 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.

  2. 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:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
rheydtcommented, May 2, 2019

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?)

3reactions
kieranbentoncommented, Feb 24, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found