Dropdown options update triggered by onSearchChange
See original GitHub issueIn my dropdown module, the options consist of a list of users which are fetched remotely and based on the search value of the dropdown.
<Form.Field
allowAdditions
control={Dropdown}
loading={this.props.loading}
onSearchChange={this.onSearchChange.bind(this)}
options={this.state.users}
placeholder="Select user"
search
selection
/>
When some characters are rendered in the seach field, the dropdown options should display the fetched results.
Strangely, this works when there is only one result. When there are more, no results are shown. I do see the options correctly shown in as <options>
in the <select>
node, but the corresponding <DropdownItem>
are not rendered. Logging the results in the console also shows them. When I blur the search box and focus it again, the results are all there. So it seems like the dropdown options don’t update when there is more than 1 result.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How to use onChange method in semantic react dropdown
You can use onSearchChange with same parameters. (I've updated the example) ... use onChange event to detect the changes in the dropdown list...
Read more >Dropdown
A dropdown's options can be controlled from outside based on search change. Try it CodeSandboxMaximizePermalink. Fetch Random Search
Read more >Step 7: Creating the user search
This step will focus on getting the user search working with the Achievers user API. You will use the Dropdown component from the...
Read more >Select
Select component allows user to pick one option from the given data ... Set searchValue and onSearchChange prop to enable controlled search in...
Read more >Mention
This plugin allows the user to choose an entry from a list. ... onSearchChangeA callback which is triggered whenever the search term changes....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jhartma Would it be possible to explain how you fixed your solution?
I am experiencing the same problem, the options will only update after a fetch once the I have clicked off screen…?
Okay I got it working, I close the issue