How can i trigger async search on button click? #4379
-
Hello everyone, Wanted Behavior
my component is:
Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Greetings @MohammedSaberMohammed, Since loadOptions is triggered when the inputValue changes and is also likely tied to the AsyncSelect being focused (though this might be an incorrect assumption). It's likely possible, but seems more complex than using a regular Select. A non-async select would give you more flexibility as to when and how you are retrieving options. To mimic the functionality you suggest, you would likely need to:
If you have any other concerns or questions about the approach, let me know and if so, putting the above code into a working codesandbox might also be helpful to iron out the implementation details. |
Beta Was this translation helpful? Give feedback.
Greetings @MohammedSaberMohammed,
Since loadOptions is triggered when the inputValue changes and is also likely tied to the AsyncSelect being focused (though this might be an incorrect assumption). It's likely possible, but seems more complex than using a regular Select.
A non-async select would give you more flexibility as to when and how you are retrieving options. To mimic the functionality you suggest, you would likely need to:
If you have any other c…