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.

react-select choice dissapears once selected

See original GitHub issue

When i make a choice, the value does not show in the select bar. I have multi-choice available, and allowCreate to be true. Im using “react-select”: “^0.9.1”. I have the value sent through redux and stored as {selectTags}. It still allows me to select correctly, it just does not show in the bar.


var options = [
    { value: 'scuba', label: 'scuba' },
    { value: 'freedive', label: 'freedive' },
    { value: 'wreck', label: 'wreck' },
];

                <Select
                  name="form-field-name"
                  options={options}
                  onChange={this.handleTagInput.bind(this,0)}
                  allowCreate={true}
                  multi={true}
                  value={selectTags}
                />

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
foodakacommented, Nov 22, 2016

from docs

The value property of each option should be set to either a string or a number.

When the value is changed, onChange(selectedValueOrValues) will fire.

1reaction
foodakacommented, Nov 22, 2016

u need to pass it a value, and your onchange must update state, which updates the value

 <Select
                  name="form-field-name"
                  options={options}
                  onChange={this.handleTagInput.bind(this)}
                  allowCreate={true}
                  multi={true}
                  value={this.props.REDUXVALUE}
                />
Read more comments on GitHub >

github_iconTop Results From Across the Web

React-Select input contents disappear when select is not ...
My issue is not with the selection items, but the contents of the textbox (The string being used to filter the options in...
Read more >
Options disappears #462 - JedWatson/react-select - GitHub
i got the select on a form and i want to validate empty inputs before ... but after a click events occuts options...
Read more >
react-select - npm
Component Injection API for complete control over the UI behaviour; Controllable state props and modular architecture; Long-requested features ...
Read more >
API - React Select
A flexible and beautiful Select Input control for ReactJS with multiselect, autocomplete and ajax support.
Read more >
React-Select Input Contents Disappear When ... - ADocLib
After picking an option from Select and clicking outside the select container Select must lose focus. ! If you're describing a bug tell...
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