gagan3012 / streamlit-tags

Custom Tag component for streamlit
https://streamlit-tags.readthedocs.io/en/latest/
MIT License
281 stars 17 forks source link

Add forms support #36

Open davnat opened 2 years ago

davnat commented 2 years ago

Hello, and thanks for this component!

I'd like to use tags inside a form, but I get a big "Component Error" text, instead.

I'm not doing anything special, so I'm assuming tags don't support being put inside a form: am I wrong?

Thank you, cheers.

Socvest commented 2 years ago

How are you implementing it? I used it in my app and it works fine with:

 with st.form("form"): 
     st_tags()
     ...
Rom1deTroyes commented 1 year ago

I can confirm that it works with with:

    with st.form("form", True):
        st.header("HeaderF")
        st.markdown("-----")
        selection_codes_articles = st_tags(
                label="Articles à chercher F:",
                text="(Code + Entrée pour ajouter)",
                value=["12345-01"],
                suggestions=["12345-01"],
                maxtags=-1,
                key="ArticlesF",
        )
        btn = st.form_submit_button('->F')

image

curiouscod3 commented 8 months ago

It doesn't integrate with the form object internally. Also, Doesn't clear tags after submit . There is no way to clear/remove tags Programmatically?