streamlit-tags icon indicating copy to clipboard operation
streamlit-tags copied to clipboard

Add forms support

Open davnat opened this issue 3 years ago • 3 comments
trafficstars

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.

davnat avatar May 19 '22 09:05 davnat

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

 with st.form("form"): 
     st_tags()
     ...

Socvest avatar Aug 06 '22 01:08 Socvest

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

Rom1deTroyes avatar Dec 22 '22 08:12 Rom1deTroyes

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?

curiouscod3 avatar Dec 30 '23 13:12 curiouscod3