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.

Cannot open dropdown after value was selected

See original GitHub issue

I have found an issue which is not allow you to re-open dropdown after value selecting.

Create component <Select options={ ... } value={ ... } />. Add additional property to prevent dropdown resizing autosize={ false }. Click on the dropdown body -> select value -> try to click on the body again… Component is not opening anymore, cuz input took some size of component and this occupied area is not clickable anymore. You can re-open input by clicking on the arrow button, click out of component and click on the body again, click at some side of component (not at the middle).

Images (GIFs) are shown in related post: https://github.com/JedWatson/react-select/issues/1886 Codesandbox: https://codesandbox.io/s/qx4v3k2py

P.S. Temporary workaround is to add autoBlur to the component which do the same click outside.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
glambertcommented, Sep 14, 2017

Found a workaround for this in the mean time, in the CSS:

.has-value.is-pseudo-focused .Select-input {
  // Always show the input even on pseudo-focused. This fixes an issue
  // when `autosize` is set to `false`, an option is chosen, and we
  // try to re-open the menu by clicking on the current option.
  // The `opacity: 0;` below makes it that we can't click to open the
  // menu unless we focus out, or click on the "clear" or "arrow".
  // More on this here: https://github.com/JedWatson/react-select/issues/1887
  // opacity: 0;
}

Not the best as it always shows the blinking cursor even if its in pseudo-focused state, but we thought its much better than not being able to re-open the menu by clicking. Also, even in pseudo-focused mode you can type, so having the text cursor clearly shows the user he can still type to change the value.

I’ll keep an eye on this issue and if I have time try to find a fix and submit a PR.

0reactions
tudiantuancommented, Oct 23, 2019

I use version “react-select”: “^2.3.0” is still cannot open dropdown after value was selected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot get the selected value in React-select - Stack Overflow
In case of value option is computed as undefined then defaultValue will be picked by react-select. For that try setting the state as...
Read more >
react-select - npm
Start using react-select in your project by running `npm i react-select`. ... defaultMenuIsOpen - set the initial open value of the menu ...
Read more >
React Select Example - Fully Customizable - YouTube
Here is a React select example with different use cases. We will build React select with a single value, React multiselect with an...
Read more >
How to Get DropDown Selected Value in React with OnChnage
in this video, I have explained how to get value from select box in react js and print the selected value.#react # dropdown...
Read more >
react-select dropdown doesn't show dropdown menu ... - Reddit
I'm trying to add some filtering systems for a React/Redux + Electron application using the 'react-select' package. However, when adding it ...
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