Closed weeks888 closed 4 months ago
Hey, thanks for the feedback! I'll add a new flag default_use_searchterm
to return the current searchterm when a user is typing in the next version 👍 You could also track this by adding the searchterm to your search function, e.g.
def search(searchterm: str): ...
st.session_state["current_search"] = searchterm
...
result = streamlit_seachbox(...)
if result is None and st.session_state.get("current_searchterm", None):
# do sth with the current seach
Might have the benefit that you'd still know if it's a selected result by the user or not (if you don't use the new flag).
Really love this component - Is it possible to pass through the current input value as opposed to the selected suggestion? The idea is for the users string to get searched by default but the suggestions are there if the user manually selects them (similar to how google works). Is this possible?