i have stanttree select widget in my streamlit app [code] but when i am passing a new…
Private research annotation
Sign in to add a private research label or note.
- User
i have st_ant_tree select widget in my streamlit app
codedef select_from_tree(data, disabled, key, placeholder): option = st_ant_tree( treeData=data, key=key, multiple=False, placeholder=placeholder, showSearch=True, treeCheckable=False, disabled=disabled, width_dropdown = "100%", ) return option file_path = select_from_tree( data=repo_tree_data, disabled=disabled_treeview, key="file_path", placeholder="Choose a File", )but when i am passing a new data to the widget the previous selected text not disappearing from UI, eventhough values is restting to None.
use a st.empty placeholder inside select_from_tree function to achieve this.
- Assistant
You can use
st.empty()to create a placeholder that allows you to manage the UI more effectively, especially if you want to clear the previous selection when new data is passed to theselect_from_treefunction. Here's an updated version of your code to achieve that:python
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.