Add checkboxes in menu items and use the menu as dropdown with async options
Version
Steps to reproduce
- I used renderMenuItemChildren to achieve this.
- on click of the custom menu item, the menu closes and select the clicked item I used the below code to mimic this behavior without need for checkboxes. So that the menu remains open while selection until it is blurred.
<AsyncTypeahead
{...this.state}
minLength={1}
onSearch={this.handleSearch}
multiple={true}
placeholder="Enter..."
open={this.state.open}
onFocus= {e=>this.setState({open: true})}
onBlur= {e=>this.setState({open: false})}
// renderMenuItemChildren={this.renderMenuItemChildren}
onChange={this.selectionChanged}
Here, the menu remains opened but the issue is the options are cleared and there is no menu item that remains.
Expected Behavior
- The checkbox should select the click item but the menu should not close.
- As the AsyncTypeahead is used here, the options should not get reset and there should not be a need to again make the API call for data.
Actual Behavior
Hi @sukhminderx, thanks for opening this issue. It sounds like you're trying to achieve a combobox behavior. You can use filterBy to control which options get filtered out; see this StackOverflow answer for more details on how to do that.
@ericgio , I added the filterBy exactly as mentioned in the link. But it does not get called. The version that I am using is: 3.4.5 What am I missing?
I'm not sure; It's hard to help you without seeing your code. Did you see the updated answer for versions > 3.0?
No response, closing.