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

Lists(except files list) do not work in sidebar forms

Open sidphbot opened this issue 2 years ago • 1 comments

Description:

lists of integers or strings (or in my assumption any other primitive type) as datatype does not work when using in sidebar form. The above does not occur and we get the clear and add item buttons but they disappear when used insidebar forms

Expected Behaviour:

this should be consistent across all forms (for my use-case at least sidebar-form)

Steps to reproduce:

class IDsModel(BaseModel):
    ids: List[str] =  Field( [], max_items=8, description="Enter ids")

with st.sidebar.form(key="dummy_form"):
    dummy_session_data = sp.pydantic_input(key="dummy_model", model=IDsModel)

P.S. love the pydantic <-> streamlit integration <3

sidphbot avatar May 29 '22 15:05 sidphbot

Just to update the behaviour occurs when the form is inside a conainer or exapnder as well

sidphbot avatar Jun 04 '22 07:06 sidphbot

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days

github-actions[bot] avatar Sep 03 '22 02:09 github-actions[bot]

Bumping as I have the same problem.

chem-william avatar Jun 03 '23 10:06 chem-william