Hi Streamlit, pardon me if this is a duplicate question while I did have tried to search but failed.
I have a text_input widget and trying to capture the event when user presses “RETURN” key. But I cannot tell it apart from other events of user interacting with other widgets. The code goes like following:
size = st.selecbox("Choose size:", ["Large", "Medium", "Small"]) text = st.text_input("Search by tag") if user_pressed_RETURN_in_text_input: # <--- How can I do this? data = do_search_by_tag(text) st.write(data) else: # user chose an option in the select box data = do_search_by_size(size) st.write(data)
Any advice is appreciated.