m-wrzr / streamlit-searchbox

Streamlit searchbox that dynamically updates and provides a list of suggestions based on a provided function
MIT License
203 stars 26 forks source link

Allow user to write a custom value not in the list #48

Closed markusdr closed 1 month ago

markusdr commented 1 month ago

It would be useful to have an option that lets the users write and select their own values in the searchbox. In that case, the list would just provide auto-complete suggestions; the user can select one of them or, alternatively, type their own.

This would behave like the Google search box: As you type it provides suggestions but it doesn't limit you to the suggested values; you can still search for something else. And, when you have accepted an auto-complete suggestion you can still edit it further.

Is there an option for such a behavior in streamlit-searchbox?

markusdr commented 1 month ago

This can be achieved by dynamically adding the user's search term to the list returned from the callback function.