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

None Selected

Open hansipie opened this issue 1 year ago • 0 comments

Hello,

Defining a selectbox like this : select = st.selectbox("title", ("A", "B"), index=None) ... I get a KeyError exception at main.py:162 This is caused by the default "None" value. It is changed into an empty space by "replace_empty(...)", but if selected != st.session_state.state_dict.get(label, None): goes into the "true" statement, and causes an exception.

The fix at main.py:161: if selected != st.session_state.state_dict.get(label, " "):

I make a PR or let you fix ...

hansipie avatar Feb 02 '24 18:02 hansipie