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

cannot inject typed text into search box as first value #16

Closed Maniwar closed 1 year ago

Maniwar commented 1 year ago

anyway i can add whatever I'm typing into the select list? If it's not on the suggestions, i can't pick my own text. seems to work on localhost, but not on cloud.

Maniwar commented 1 year ago
Screenshot 2023-05-09 at 10 19 00 PM

local-host above cloud below

Maniwar commented 1 year ago

Screenshot 2023-05-09 at 10 20 41 PM

m-wrzr commented 1 year ago

Hey, could it be an sorting issue? Both localhost/cloud seem to have different result lists?

Otherwise, if you want to make sure the input is available in the selections, it would have to be added to the provided search function.

Maniwar commented 1 year ago

Thank you! My mistake. This fixed it

Insert the user input as the first option

results.insert(0, query)

On Fri, May 12, 2023 at 4:36 AM m-wrzr @.***> wrote:

Hey, could it be an sorting issue? Both localhost/cloud seem to have different result lists?

Otherwise, if you want to make sure the input is available in the selections, it would have to be added to the provided search function.

— Reply to this email directly, view it on GitHub https://github.com/m-wrzr/streamlit-searchbox/issues/16#issuecomment-1545605472, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADNEEQWYPCX7365UDG7VUE3XFYODRANCNFSM6AAAAAAX4FANEU . You are receiving this because you authored the thread.Message ID: @.***>