Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tags does not get updated upon button click event #28

Open
hassiahk opened this issue Jul 15, 2021 · 4 comments
Open

Tags does not get updated upon button click event #28

hassiahk opened this issue Jul 15, 2021 · 4 comments

Comments

@hassiahk
Copy link

I am trying to update the tags upon a button click event but the tags are not getting updated.

I have a list of tags that I define at the start and then upon clicking the button this list gets updated but st_tags component does not update the tags. Below is the script I am using:

import streamlit as st
from streamlit_tags import st_tags


tags = ['hello', 'world']
options = ['hey', 'hi']

add_button = st.sidebar.button("SUBMIT")
if add_button:
    tags = ['hello', 'python']
    
custom_keywords = st_tags(
    label="",
    text="Press enter to add more",
    value=tags,
    suggestions=options,
    maxtags=15,
    key="1",
)

st.multiselect does update the options upon clicking the button.

original_keywords = st.multiselect(
    "Choose a word",
    options,
    tags,
)

Any way I can achieve this with st_tags? 😄

Thanks in advance!

@gagan3012
Copy link
Owner

Hello,
Yes it can be done I will include it in the coming release

@hassiahk
Copy link
Author

hassiahk commented Jul 15, 2021

Hello,
Yes it can be done I will include it in the coming release

That would be great to have!

Any workaround for now? I am pretty new to streamlit 😄

@gagan3012
Copy link
Owner

Hi,
So the tags that are supplied cannot be changed as it takes static input only because the tags we provide are just starting points since we have a manual input method the I choose not to have it updated every time to maintain the stability of streamlit-tags

To do something like this we can input them manually from the UI.

@rolandgvc
Copy link

Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants