Closed sfc-gh-pkommini closed 1 year ago
@m-wrzr Could you please review and help get this merged into a release?
Hey @sfc-gh-pkommini thanks for the PR, I built it locally and it works.
Adding the searchterm as an option is a good idea, but currently this can also be achieved by adding it as a first option to the search_function
you pass. Would there be any benefits to using ReactCreatable
over this approach?
Also, not every user might want to add the searchterm as a selectable option, so it would be good to have a flag that can be passed, similar to clear_on_submit
since people have different usecases.
@m-wrzr I didn't realize I could achieve the same result from the function. Thank you. Closing the PR.
Fixes #18.
Changes
CreatableSelect
instead ofSelect
fromreact-select
library to add thesearchterm
value to the options that is displayed as suggestions as the input is typesession_state
Testing
Was able to test the fix and get the
searchterm
itself added as one of the options that is submitted to mirror a google search like experience. Google search: Shows the search term as the first suggestionMy streamlit app shows the
searchterm
itself as a suggestion:I used the code in this PR built using
python setup.py sdist bdist_wheel
command and then installing the wheel file into my streamlit app's conda environment.@m-wrzr Let me know if you like to see any improvement or you're satisfied with the change.