Reputation: 12729
Could you please tell me how to show select box on focus of input field and close after select item from the drop down? Here is my code
return (
<div className="App">
<Select
value={selectedOption}
closeMenuOnSelect={false}
menuIsOpen={menuIsOpen}
isMulti={true}
className="select-item"
classNamePrefix="select-item"
onInputChange={() => this.setState({ menuIsOpen: true })}
onChange={this.handleSelectedChange}
options={options}
/>
</div>
);
https://codesandbox.io/s/5v41wrxw9n
using this plugin https://github.com/JedWatson/react-select
Upvotes: 0
Views: 2532
Reputation: 607
Refer to the link for updated code: https://codesandbox.io/s/mmjvp25z38
Upvotes: 3